@microsoft/teamsfx-core 1.4.0 → 1.4.1-alpha.0535e2d27.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 +1 -0
- package/build/common/constants.d.ts.map +1 -1
- package/build/common/constants.js +1 -0
- package/build/common/constants.js.map +1 -1
- package/build/common/local/constants.d.ts +0 -4
- package/build/common/local/constants.d.ts.map +1 -1
- package/build/common/local/constants.js +1 -5
- package/build/common/local/constants.js.map +1 -1
- package/build/common/local/localEnvProvider.d.ts +4 -8
- package/build/common/local/localEnvProvider.d.ts.map +1 -1
- package/build/common/local/localEnvProvider.js +21 -33
- package/build/common/local/localEnvProvider.js.map +1 -1
- package/build/common/local/localSettingsHelper.d.ts.map +1 -1
- package/build/common/local/localSettingsHelper.js +12 -21
- package/build/common/local/localSettingsHelper.js.map +1 -1
- package/build/common/local/portChecker.d.ts.map +1 -1
- package/build/common/local/portChecker.js +1 -8
- package/build/common/local/portChecker.js.map +1 -1
- package/build/common/local/projectSettingsHelper.d.ts +0 -1
- package/build/common/local/projectSettingsHelper.d.ts.map +1 -1
- package/build/common/local/projectSettingsHelper.js +2 -5
- package/build/common/local/projectSettingsHelper.js.map +1 -1
- package/build/common/localSettingsProvider.d.ts +2 -2
- package/build/common/localSettingsProvider.d.ts.map +1 -1
- package/build/common/localSettingsProvider.js +4 -4
- package/build/common/localSettingsProvider.js.map +1 -1
- package/build/common/projectSettingsValidator.d.ts.map +1 -1
- package/build/common/projectSettingsValidator.js +5 -0
- package/build/common/projectSettingsValidator.js.map +1 -1
- package/build/common/samples-config.json +12 -2
- package/build/common/template-utils/templates.d.ts +1 -0
- package/build/common/template-utils/templates.d.ts.map +1 -1
- package/build/common/template-utils/templates.js +5 -1
- package/build/common/template-utils/templates.js.map +1 -1
- package/build/common/templates-config.json +2 -2
- package/build/common/tools.d.ts +0 -4
- package/build/common/tools.d.ts.map +1 -1
- package/build/common/tools.js +1 -20
- package/build/common/tools.js.map +1 -1
- package/build/core/SolutionPluginContainer.js +1 -1
- package/build/core/SolutionPluginContainer.js.map +1 -1
- package/build/core/collaborator.d.ts +10 -0
- package/build/core/collaborator.d.ts.map +1 -0
- package/build/core/collaborator.js +381 -0
- package/build/core/collaborator.js.map +1 -0
- package/build/core/environment.d.ts.map +1 -1
- package/build/core/environment.js +7 -2
- package/build/core/environment.js.map +1 -1
- package/build/core/error.d.ts +0 -6
- package/build/core/error.d.ts.map +1 -1
- package/build/core/error.js +1 -25
- package/build/core/error.js.map +1 -1
- package/build/core/index.d.ts +11 -9
- package/build/core/index.d.ts.map +1 -1
- package/build/core/index.js +232 -233
- package/build/core/index.js.map +1 -1
- package/build/core/middleware/concurrentLocker.d.ts.map +1 -1
- package/build/core/middleware/concurrentLocker.js +1 -2
- package/build/core/middleware/concurrentLocker.js.map +1 -1
- package/build/core/middleware/envInfoLoaderV3.d.ts.map +1 -1
- package/build/core/middleware/envInfoLoaderV3.js +3 -0
- package/build/core/middleware/envInfoLoaderV3.js.map +1 -1
- package/build/core/middleware/index.d.ts +0 -2
- package/build/core/middleware/index.d.ts.map +1 -1
- package/build/core/middleware/index.js +0 -2
- package/build/core/middleware/index.js.map +1 -1
- package/build/core/middleware/localSettingsLoader.d.ts.map +1 -1
- package/build/core/middleware/localSettingsLoader.js +2 -2
- package/build/core/middleware/localSettingsLoader.js.map +1 -1
- package/build/core/middleware/projectMigrator.d.ts.map +1 -1
- package/build/core/middleware/projectMigrator.js +28 -35
- package/build/core/middleware/projectMigrator.js.map +1 -1
- package/build/core/middleware/questionModel.d.ts +0 -1
- package/build/core/middleware/questionModel.d.ts.map +1 -1
- package/build/core/middleware/questionModel.js +48 -71
- package/build/core/middleware/questionModel.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 +1 -8
- package/build/core/middleware/solutionLoaderV3.js.map +1 -1
- package/build/core/question.d.ts +0 -1
- package/build/core/question.d.ts.map +1 -1
- package/build/core/question.js +1 -26
- package/build/core/question.js.map +1 -1
- package/build/core/tools.d.ts +0 -2
- package/build/core/tools.d.ts.map +1 -1
- package/build/core/tools.js +3 -63
- package/build/core/tools.js.map +1 -1
- package/build/core/utils.d.ts +1 -2
- package/build/core/utils.d.ts.map +1 -1
- package/build/core/utils.js +1 -5
- package/build/core/utils.js.map +1 -1
- package/build/plugins/resource/aad/aadAppClient.d.ts +4 -4
- package/build/plugins/resource/aad/aadAppClient.d.ts.map +1 -1
- package/build/plugins/resource/aad/aadAppClient.js +3 -3
- package/build/plugins/resource/aad/aadAppClient.js.map +1 -1
- package/build/plugins/resource/aad/index.d.ts.map +1 -1
- package/build/plugins/resource/aad/index.js +0 -3
- package/build/plugins/resource/aad/index.js.map +1 -1
- package/build/plugins/resource/aad/plugin.d.ts.map +1 -1
- package/build/plugins/resource/aad/plugin.js +13 -8
- package/build/plugins/resource/aad/plugin.js.map +1 -1
- package/build/plugins/resource/aad/v2/index.d.ts +3 -2
- package/build/plugins/resource/aad/v2/index.d.ts.map +1 -1
- package/build/plugins/resource/aad/v2/index.js +4 -4
- package/build/plugins/resource/aad/v2/index.js.map +1 -1
- package/build/plugins/resource/aad/v3/index.d.ts +8 -2
- package/build/plugins/resource/aad/v3/index.d.ts.map +1 -1
- package/build/plugins/resource/aad/v3/index.js +148 -49
- package/build/plugins/resource/aad/v3/index.js.map +1 -1
- package/build/plugins/resource/apim/config.js +2 -1
- package/build/plugins/resource/apim/config.js.map +1 -1
- package/build/plugins/resource/apim/managers/questionManager.d.ts.map +1 -1
- package/build/plugins/resource/apim/managers/questionManager.js +8 -4
- package/build/plugins/resource/apim/managers/questionManager.js.map +1 -1
- package/build/plugins/resource/apim/v3/index.d.ts +7 -7
- package/build/plugins/resource/apim/v3/index.d.ts.map +1 -1
- package/build/plugins/resource/apim/v3/index.js +63 -55
- package/build/plugins/resource/apim/v3/index.js.map +1 -1
- package/build/plugins/resource/appstudio/appStudio.js +1 -1
- package/build/plugins/resource/appstudio/appStudio.js.map +1 -1
- package/build/plugins/resource/appstudio/errors.d.ts +8 -16
- package/build/plugins/resource/appstudio/errors.d.ts.map +1 -1
- package/build/plugins/resource/appstudio/errors.js +8 -16
- package/build/plugins/resource/appstudio/errors.js.map +1 -1
- package/build/plugins/resource/appstudio/index.d.ts +0 -4
- package/build/plugins/resource/appstudio/index.d.ts.map +1 -1
- package/build/plugins/resource/appstudio/index.js +0 -21
- package/build/plugins/resource/appstudio/index.js.map +1 -1
- package/build/plugins/resource/appstudio/manifestTemplate.d.ts +3 -1
- package/build/plugins/resource/appstudio/manifestTemplate.d.ts.map +1 -1
- package/build/plugins/resource/appstudio/manifestTemplate.js +111 -1
- package/build/plugins/resource/appstudio/manifestTemplate.js.map +1 -1
- package/build/plugins/resource/appstudio/plugin.d.ts +2 -13
- package/build/plugins/resource/appstudio/plugin.d.ts.map +1 -1
- package/build/plugins/resource/appstudio/plugin.js +46 -127
- package/build/plugins/resource/appstudio/plugin.js.map +1 -1
- package/build/plugins/resource/appstudio/utils/telemetry.d.ts +1 -1
- package/build/plugins/resource/appstudio/utils/telemetry.d.ts.map +1 -1
- package/build/plugins/resource/appstudio/utils/telemetry.js +22 -10
- package/build/plugins/resource/appstudio/utils/telemetry.js.map +1 -1
- package/build/plugins/resource/appstudio/v2/index.d.ts +2 -2
- package/build/plugins/resource/appstudio/v2/index.d.ts.map +1 -1
- package/build/plugins/resource/appstudio/v2/index.js +2 -2
- package/build/plugins/resource/appstudio/v2/index.js.map +1 -1
- package/build/plugins/resource/appstudio/v3/index.d.ts +24 -4
- package/build/plugins/resource/appstudio/v3/index.d.ts.map +1 -1
- package/build/plugins/resource/appstudio/v3/index.js +133 -5
- package/build/plugins/resource/appstudio/v3/index.js.map +1 -1
- package/build/plugins/resource/appstudio/v3/plugin.d.ts +17 -4
- package/build/plugins/resource/appstudio/v3/plugin.d.ts.map +1 -1
- package/build/plugins/resource/appstudio/v3/plugin.js +117 -25
- package/build/plugins/resource/appstudio/v3/plugin.js.map +1 -1
- package/build/plugins/resource/bot/configs/deployConfig.js.map +1 -1
- package/build/plugins/resource/bot/constants.d.ts +0 -4
- package/build/plugins/resource/bot/constants.d.ts.map +1 -1
- package/build/plugins/resource/bot/constants.js +0 -6
- package/build/plugins/resource/bot/constants.js.map +1 -1
- package/build/plugins/resource/bot/dotnet/plugin.d.ts +0 -3
- package/build/plugins/resource/bot/dotnet/plugin.d.ts.map +1 -1
- package/build/plugins/resource/bot/dotnet/plugin.js +0 -9
- package/build/plugins/resource/bot/dotnet/plugin.js.map +1 -1
- package/build/plugins/resource/bot/errors.d.ts +0 -3
- package/build/plugins/resource/bot/errors.d.ts.map +1 -1
- package/build/plugins/resource/bot/errors.js +1 -9
- package/build/plugins/resource/bot/errors.js.map +1 -1
- package/build/plugins/resource/bot/index.d.ts +2 -3
- package/build/plugins/resource/bot/index.d.ts.map +1 -1
- package/build/plugins/resource/bot/index.js +5 -16
- package/build/plugins/resource/bot/index.js.map +1 -1
- package/build/plugins/resource/bot/interface.d.ts +0 -1
- package/build/plugins/resource/bot/interface.d.ts.map +1 -1
- package/build/plugins/resource/bot/plugin.d.ts +0 -1
- package/build/plugins/resource/bot/plugin.d.ts.map +1 -1
- package/build/plugins/resource/bot/plugin.js +0 -26
- package/build/plugins/resource/bot/plugin.js.map +1 -1
- package/build/plugins/resource/bot/progressBars.d.ts +2 -2
- package/build/plugins/resource/bot/progressBars.d.ts.map +1 -1
- package/build/plugins/resource/bot/progressBars.js +4 -3
- package/build/plugins/resource/bot/progressBars.js.map +1 -1
- package/build/plugins/resource/bot/resources/messages.d.ts +0 -3
- package/build/plugins/resource/bot/resources/messages.d.ts.map +1 -1
- package/build/plugins/resource/bot/resources/messages.js +0 -5
- package/build/plugins/resource/bot/resources/messages.js.map +1 -1
- package/build/plugins/resource/bot/resources/strings.d.ts +0 -1
- package/build/plugins/resource/bot/resources/strings.d.ts.map +1 -1
- package/build/plugins/resource/bot/resources/strings.js +0 -2
- package/build/plugins/resource/bot/resources/strings.js.map +1 -1
- package/build/plugins/resource/bot/v3/error.d.ts +15 -0
- package/build/plugins/resource/bot/v3/error.d.ts.map +1 -0
- package/build/plugins/resource/bot/v3/error.js +46 -0
- package/build/plugins/resource/bot/v3/error.js.map +1 -0
- package/build/plugins/resource/bot/v3/index.d.ts +19 -0
- package/build/plugins/resource/bot/v3/index.d.ts.map +1 -0
- package/build/plugins/resource/bot/v3/index.js +376 -0
- package/build/plugins/resource/bot/v3/index.js.map +1 -0
- package/build/plugins/resource/frontend/constants.d.ts +1 -0
- package/build/plugins/resource/frontend/constants.d.ts.map +1 -1
- package/build/plugins/resource/frontend/constants.js +1 -0
- package/build/plugins/resource/frontend/constants.js.map +1 -1
- package/build/plugins/resource/frontend/dotnet/constants.d.ts +21 -0
- package/build/plugins/resource/frontend/dotnet/constants.d.ts.map +1 -1
- package/build/plugins/resource/frontend/dotnet/constants.js +23 -1
- package/build/plugins/resource/frontend/dotnet/constants.js.map +1 -1
- package/build/plugins/resource/frontend/dotnet/plugin.d.ts +1 -0
- package/build/plugins/resource/frontend/dotnet/plugin.d.ts.map +1 -1
- package/build/plugins/resource/frontend/dotnet/plugin.js +59 -0
- package/build/plugins/resource/frontend/dotnet/plugin.js.map +1 -1
- package/build/plugins/resource/frontend/dotnet/resources/errors.d.ts +3 -0
- package/build/plugins/resource/frontend/dotnet/resources/errors.d.ts.map +1 -1
- package/build/plugins/resource/frontend/dotnet/resources/errors.js +10 -1
- package/build/plugins/resource/frontend/dotnet/resources/errors.js.map +1 -1
- package/build/plugins/resource/frontend/index.d.ts +2 -3
- package/build/plugins/resource/frontend/index.d.ts.map +1 -1
- package/build/plugins/resource/frontend/index.js +5 -9
- package/build/plugins/resource/frontend/index.js.map +1 -1
- package/build/plugins/resource/frontend/interface.d.ts +2 -2
- package/build/plugins/resource/frontend/interface.d.ts.map +1 -1
- package/build/plugins/resource/frontend/plugin.d.ts +2 -2
- package/build/plugins/resource/frontend/plugin.d.ts.map +1 -1
- package/build/plugins/resource/frontend/plugin.js +12 -25
- package/build/plugins/resource/frontend/plugin.js.map +1 -1
- package/build/plugins/resource/frontend/resources/errors.d.ts +0 -7
- package/build/plugins/resource/frontend/resources/errors.d.ts.map +1 -1
- package/build/plugins/resource/frontend/resources/errors.js +1 -14
- 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/steps.d.ts +0 -1
- package/build/plugins/resource/frontend/resources/steps.d.ts.map +1 -1
- package/build/plugins/resource/frontend/resources/steps.js +1 -7
- package/build/plugins/resource/frontend/resources/steps.js.map +1 -1
- package/build/plugins/resource/frontend/v2/index.d.ts +3 -2
- package/build/plugins/resource/frontend/v2/index.d.ts.map +1 -1
- package/build/plugins/resource/frontend/v2/index.js +5 -2
- package/build/plugins/resource/frontend/v2/index.js.map +1 -1
- package/build/plugins/resource/frontend/v3/index.d.ts +7 -7
- package/build/plugins/resource/frontend/v3/index.d.ts.map +1 -1
- package/build/plugins/resource/frontend/v3/index.js +21 -28
- package/build/plugins/resource/frontend/v3/index.js.map +1 -1
- package/build/plugins/resource/function/v3/index.d.ts +8 -9
- package/build/plugins/resource/function/v3/index.d.ts.map +1 -1
- package/build/plugins/resource/function/v3/index.js +20 -26
- package/build/plugins/resource/function/v3/index.js.map +1 -1
- package/build/plugins/resource/identity/index.d.ts.map +1 -1
- package/build/plugins/resource/identity/index.js +0 -3
- package/build/plugins/resource/identity/index.js.map +1 -1
- package/build/plugins/resource/identity/v3/index.d.ts +4 -4
- package/build/plugins/resource/identity/v3/index.d.ts.map +1 -1
- package/build/plugins/resource/identity/v3/index.js +10 -14
- package/build/plugins/resource/identity/v3/index.js.map +1 -1
- package/build/plugins/resource/keyvault/v3/index.d.ts +5 -6
- package/build/plugins/resource/keyvault/v3/index.d.ts.map +1 -1
- package/build/plugins/resource/keyvault/v3/index.js +10 -17
- package/build/plugins/resource/keyvault/v3/index.js.map +1 -1
- package/build/plugins/resource/localdebug/constants.d.ts +0 -4
- package/build/plugins/resource/localdebug/constants.d.ts.map +1 -1
- package/build/plugins/resource/localdebug/constants.js +1 -5
- package/build/plugins/resource/localdebug/constants.js.map +1 -1
- package/build/plugins/resource/localdebug/localEnv.d.ts +2 -2
- package/build/plugins/resource/localdebug/localEnv.d.ts.map +1 -1
- package/build/plugins/resource/localdebug/localEnv.js +4 -6
- package/build/plugins/resource/localdebug/localEnv.js.map +1 -1
- package/build/plugins/resource/localdebug/projectSettingLoader.d.ts +0 -1
- package/build/plugins/resource/localdebug/projectSettingLoader.d.ts.map +1 -1
- package/build/plugins/resource/localdebug/projectSettingLoader.js +0 -1
- package/build/plugins/resource/localdebug/projectSettingLoader.js.map +1 -1
- package/build/plugins/resource/spfx/index.d.ts +1 -5
- package/build/plugins/resource/spfx/index.d.ts.map +1 -1
- package/build/plugins/resource/spfx/index.js +6 -10
- package/build/plugins/resource/spfx/index.js.map +1 -1
- package/build/plugins/resource/spfx/plugin.js +6 -6
- package/build/plugins/resource/spfx/plugin.js.map +1 -1
- package/build/plugins/resource/spfx/utils/constants.d.ts +9 -0
- package/build/plugins/resource/spfx/utils/constants.d.ts.map +1 -1
- package/build/plugins/resource/spfx/utils/constants.js +11 -1
- package/build/plugins/resource/spfx/utils/constants.js.map +1 -1
- package/build/plugins/resource/spfx/utils/progress-helper.d.ts +3 -3
- package/build/plugins/resource/spfx/utils/progress-helper.d.ts.map +1 -1
- package/build/plugins/resource/spfx/utils/progress-helper.js +8 -8
- package/build/plugins/resource/spfx/utils/progress-helper.js.map +1 -1
- package/build/plugins/resource/spfx/utils/questions.d.ts +10 -0
- package/build/plugins/resource/spfx/utils/questions.d.ts.map +1 -0
- package/build/plugins/resource/spfx/utils/questions.js +39 -0
- package/build/plugins/resource/spfx/utils/questions.js.map +1 -0
- package/build/plugins/resource/spfx/v3/error.d.ts +5 -0
- package/build/plugins/resource/spfx/v3/error.d.ts.map +1 -0
- package/build/plugins/resource/spfx/v3/error.js +20 -0
- package/build/plugins/resource/spfx/v3/error.js.map +1 -0
- package/build/plugins/resource/spfx/v3/index.d.ts +13 -0
- package/build/plugins/resource/spfx/v3/index.d.ts.map +1 -0
- package/build/plugins/resource/spfx/v3/index.js +122 -0
- package/build/plugins/resource/spfx/v3/index.js.map +1 -0
- package/build/plugins/resource/spfx/v3/plugin.d.ts +11 -0
- package/build/plugins/resource/spfx/v3/plugin.d.ts.map +1 -0
- package/build/plugins/resource/spfx/v3/plugin.js +290 -0
- package/build/plugins/resource/spfx/v3/plugin.js.map +1 -0
- package/build/plugins/resource/sql/v3/index.d.ts +9 -6
- package/build/plugins/resource/sql/v3/index.d.ts.map +1 -1
- package/build/plugins/resource/sql/v3/index.js +82 -20
- package/build/plugins/resource/sql/v3/index.js.map +1 -1
- package/build/plugins/resource/utils4v2.d.ts +3 -2
- package/build/plugins/resource/utils4v2.d.ts.map +1 -1
- package/build/plugins/resource/utils4v2.js +24 -7
- package/build/plugins/resource/utils4v2.js.map +1 -1
- package/build/plugins/solution/fx-solution/arm.d.ts +2 -2
- package/build/plugins/solution/fx-solution/arm.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/arm.js +52 -59
- package/build/plugins/solution/fx-solution/arm.js.map +1 -1
- package/build/plugins/solution/fx-solution/commonQuestions.d.ts +15 -3
- package/build/plugins/solution/fx-solution/commonQuestions.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/commonQuestions.js +14 -8
- package/build/plugins/solution/fx-solution/commonQuestions.js.map +1 -1
- package/build/plugins/solution/fx-solution/constants.d.ts +0 -2
- package/build/plugins/solution/fx-solution/constants.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/constants.js +0 -2
- package/build/plugins/solution/fx-solution/constants.js.map +1 -1
- package/build/plugins/solution/fx-solution/debug/error.d.ts +0 -1
- package/build/plugins/solution/fx-solution/debug/error.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/debug/error.js +1 -5
- package/build/plugins/solution/fx-solution/debug/error.js.map +1 -1
- package/build/plugins/solution/fx-solution/debug/provisionLocal.d.ts +3 -0
- package/build/plugins/solution/fx-solution/debug/provisionLocal.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/debug/provisionLocal.js +254 -28
- package/build/plugins/solution/fx-solution/debug/provisionLocal.js.map +1 -1
- package/build/plugins/solution/fx-solution/debug/scaffolding.d.ts +3 -4
- package/build/plugins/solution/fx-solution/debug/scaffolding.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/debug/scaffolding.js +18 -19
- package/build/plugins/solution/fx-solution/debug/scaffolding.js.map +1 -1
- package/build/plugins/solution/fx-solution/debug/util/launch.d.ts +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 +109 -290
- package/build/plugins/solution/fx-solution/debug/util/launch.js.map +1 -1
- package/build/plugins/solution/fx-solution/debug/util/launchNext.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/debug/util/launchNext.js +102 -236
- package/build/plugins/solution/fx-solution/debug/util/launchNext.js.map +1 -1
- package/build/plugins/solution/fx-solution/debug/util/tasks.d.ts +1 -1
- package/build/plugins/solution/fx-solution/debug/util/tasks.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/debug/util/tasks.js +12 -18
- package/build/plugins/solution/fx-solution/debug/util/tasks.js.map +1 -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 +5 -5
- package/build/plugins/solution/fx-solution/debug/util/tasksNext.js.map +1 -1
- package/build/plugins/solution/fx-solution/question.d.ts +0 -2
- package/build/plugins/solution/fx-solution/question.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/question.js +1 -14
- package/build/plugins/solution/fx-solution/question.js.map +1 -1
- package/build/plugins/solution/fx-solution/solution.d.ts +0 -2
- package/build/plugins/solution/fx-solution/solution.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/solution.js +4 -84
- package/build/plugins/solution/fx-solution/solution.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 +17 -0
- package/build/plugins/solution/fx-solution/v2/deploy.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 +1 -6
- package/build/plugins/solution/fx-solution/v2/getQuestions.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 +4 -0
- package/build/plugins/solution/fx-solution/v2/provision.js.map +1 -1
- package/build/plugins/solution/fx-solution/v2/provisionLocal.d.ts +2 -0
- package/build/plugins/solution/fx-solution/v2/provisionLocal.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/v2/provisionLocal.js +52 -11
- package/build/plugins/solution/fx-solution/v2/provisionLocal.js.map +1 -1
- package/build/plugins/solution/fx-solution/v2/scaffolding.d.ts +1 -1
- package/build/plugins/solution/fx-solution/v2/scaffolding.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/v2/scaffolding.js +5 -8
- package/build/plugins/solution/fx-solution/v2/scaffolding.js.map +1 -1
- package/build/plugins/solution/fx-solution/v2/utils.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/v2/utils.js +0 -3
- package/build/plugins/solution/fx-solution/v2/utils.js.map +1 -1
- package/build/plugins/solution/fx-solution/v3/addFeature.d.ts +4 -3
- package/build/plugins/solution/fx-solution/v3/addFeature.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/v3/addFeature.js +124 -45
- package/build/plugins/solution/fx-solution/v3/addFeature.js.map +1 -1
- package/build/plugins/solution/fx-solution/v3/constants.d.ts +0 -1
- package/build/plugins/solution/fx-solution/v3/constants.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/v3/constants.js +2 -3
- package/build/plugins/solution/fx-solution/v3/constants.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 +21 -11
- 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 +37 -24
- package/build/plugins/solution/fx-solution/v3/provision.js.map +1 -1
- package/build/plugins/solution/fx-solution/v3/solution.js +2 -2
- package/build/plugins/solution/fx-solution/v3/solution.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 +58 -58
- 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 +0 -8
- package/build/plugins/solution/spfx-solution/addFeature.js.map +1 -1
- package/build/plugins/solution/utils/questions.d.ts +3 -3
- package/build/plugins/solution/utils/questions.d.ts.map +1 -1
- package/build/plugins/solution/utils/questions.js +6 -6
- package/build/plugins/solution/utils/questions.js.map +1 -1
- package/package.json +4 -3
- package/resource/strings.json +1 -0
- 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/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/bot/msgext.js.default.zip +0 -0
- package/templates/plugins/resource/bot/msgext.ts.default.zip +0 -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/core/middleware/migrateConditionHandler.d.ts +0 -3
- package/build/core/middleware/migrateConditionHandler.d.ts.map +0 -1
- package/build/core/middleware/migrateConditionHandler.js +0 -23
- package/build/core/middleware/migrateConditionHandler.js.map +0 -1
- package/build/core/middleware/supportV1ConditionHandler.d.ts +0 -3
- package/build/core/middleware/supportV1ConditionHandler.d.ts.map +0 -1
- package/build/core/middleware/supportV1ConditionHandler.js +0 -23
- package/build/core/middleware/supportV1ConditionHandler.js.map +0 -1
- package/build/core/middleware/telemetrySender.d.ts +0 -6
- package/build/core/middleware/telemetrySender.d.ts.map +0 -1
- package/build/core/middleware/telemetrySender.js +0 -43
- package/build/core/middleware/telemetrySender.js.map +0 -1
- package/templates/plugins/resource/storage/bicep/azureStorageProvision.bicep +0 -25
- package/templates/plugins/resource/storage/bicep/provision.template.bicep +0 -15
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SPFxPluginV3 = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const lib_1 = require("@feathersjs/hooks/lib");
|
|
6
|
+
const teamsfx_api_1 = require("@microsoft/teamsfx-api");
|
|
7
|
+
const typedi_1 = require("typedi");
|
|
8
|
+
const CommonErrorHandlerMW_1 = require("../../../../core/middleware/CommonErrorHandlerMW");
|
|
9
|
+
const constants_1 = require("../../../solution/fx-solution/v3/constants");
|
|
10
|
+
const solutionSettingsHelper_1 = require("../../../solution/fx-solution/utils/solutionSettingsHelper");
|
|
11
|
+
const question_1 = require("../../../solution/fx-solution/question");
|
|
12
|
+
const error_1 = require("./error");
|
|
13
|
+
const uuid = tslib_1.__importStar(require("uuid"));
|
|
14
|
+
const questions_1 = require("../utils/questions");
|
|
15
|
+
const plugin_1 = require("./plugin");
|
|
16
|
+
const constants_2 = require("../utils/constants");
|
|
17
|
+
const util = tslib_1.__importStar(require("util"));
|
|
18
|
+
let SPFxPluginV3 = class SPFxPluginV3 {
|
|
19
|
+
constructor() {
|
|
20
|
+
this.name = constants_1.BuiltInFeaturePluginNames.spfx;
|
|
21
|
+
this.displayName = "SPFx";
|
|
22
|
+
this.description = "SharePoint Framework (SPFx)";
|
|
23
|
+
this.spfxPluginImpl = new plugin_1.SPFxPluginImpl();
|
|
24
|
+
}
|
|
25
|
+
async getQuestionsForAddInstance(ctx, inputs) {
|
|
26
|
+
const spfx_frontend_host = new teamsfx_api_1.QTreeNode({
|
|
27
|
+
type: "group",
|
|
28
|
+
});
|
|
29
|
+
const spfx_framework_type = new teamsfx_api_1.QTreeNode(questions_1.frameworkQuestion);
|
|
30
|
+
spfx_frontend_host.addChild(spfx_framework_type);
|
|
31
|
+
const spfx_webpart_name = new teamsfx_api_1.QTreeNode(questions_1.webpartNameQuestion);
|
|
32
|
+
spfx_frontend_host.addChild(spfx_webpart_name);
|
|
33
|
+
const spfx_webpart_desp = new teamsfx_api_1.QTreeNode(questions_1.webpartDescriptionQuestion);
|
|
34
|
+
spfx_frontend_host.addChild(spfx_webpart_desp);
|
|
35
|
+
return teamsfx_api_1.ok(spfx_frontend_host);
|
|
36
|
+
}
|
|
37
|
+
async addInstance(ctx, inputs) {
|
|
38
|
+
solutionSettingsHelper_1.ensureSolutionSettings(ctx.projectSetting);
|
|
39
|
+
const solutionSettings = ctx.projectSetting.solutionSettings;
|
|
40
|
+
const capabilities = solutionSettings.capabilities;
|
|
41
|
+
if (capabilities.includes(question_1.TabSPFxItem.id)) {
|
|
42
|
+
return teamsfx_api_1.err(error_1.SPFxAlreadyExistError());
|
|
43
|
+
}
|
|
44
|
+
const componentId = uuid.v4();
|
|
45
|
+
const webpartName = inputs[questions_1.SPFXQuestionNames.webpart_name];
|
|
46
|
+
// spfx is added for first time, scaffold and generate resource template
|
|
47
|
+
const scaffoldRes = await this.spfxPluginImpl.scaffold(ctx, inputs, componentId);
|
|
48
|
+
if (scaffoldRes.isErr())
|
|
49
|
+
return teamsfx_api_1.err(scaffoldRes.error);
|
|
50
|
+
capabilities.push(question_1.TabSPFxItem.id);
|
|
51
|
+
const capabilitiesToAddManifest = [];
|
|
52
|
+
const localStaticSnippet = {
|
|
53
|
+
entityId: componentId,
|
|
54
|
+
name: webpartName,
|
|
55
|
+
contentUrl: util.format(constants_2.ManifestTemplate.LOCAL_CONTENT_URL, componentId),
|
|
56
|
+
websiteUrl: constants_2.ManifestTemplate.WEBSITE_URL,
|
|
57
|
+
scopes: ["personal"],
|
|
58
|
+
};
|
|
59
|
+
const localConfigurableSnippet = {
|
|
60
|
+
configurationUrl: util.format(constants_2.ManifestTemplate.LOCAL_CONFIGURATION_URL, componentId),
|
|
61
|
+
canUpdateConfiguration: true,
|
|
62
|
+
scopes: ["team"],
|
|
63
|
+
};
|
|
64
|
+
const remoteStaticSnippet = {
|
|
65
|
+
entityId: componentId,
|
|
66
|
+
name: webpartName,
|
|
67
|
+
contentUrl: util.format(constants_2.ManifestTemplate.REMOTE_CONTENT_URL, componentId),
|
|
68
|
+
websiteUrl: constants_2.ManifestTemplate.WEBSITE_URL,
|
|
69
|
+
scopes: ["personal"],
|
|
70
|
+
};
|
|
71
|
+
const remoteConfigurableSnippet = {
|
|
72
|
+
configurationUrl: util.format(constants_2.ManifestTemplate.REMOTE_CONFIGURATION_URL, componentId),
|
|
73
|
+
canUpdateConfiguration: true,
|
|
74
|
+
scopes: ["team"],
|
|
75
|
+
};
|
|
76
|
+
capabilitiesToAddManifest.push({ name: "staticTab", snippet: { local: localStaticSnippet, remote: remoteStaticSnippet } }, {
|
|
77
|
+
name: "configurableTab",
|
|
78
|
+
snippet: { local: localConfigurableSnippet, remote: remoteConfigurableSnippet },
|
|
79
|
+
});
|
|
80
|
+
const addCapRes = await ctx.appManifestProvider.addCapabilities(ctx, inputs, capabilitiesToAddManifest);
|
|
81
|
+
if (addCapRes.isErr())
|
|
82
|
+
return teamsfx_api_1.err(addCapRes.error);
|
|
83
|
+
const webAppInfo = {
|
|
84
|
+
name: "WebApplicationInfo",
|
|
85
|
+
snippet: {
|
|
86
|
+
resource: constants_2.ManifestTemplate.WEB_APP_INFO_RESOURCE,
|
|
87
|
+
id: constants_2.ManifestTemplate.WEB_APP_INFO_ID,
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
const updateWebAppInfoRes = await ctx.appManifestProvider.updateCapability(ctx, inputs, webAppInfo);
|
|
91
|
+
if (updateWebAppInfoRes.isErr())
|
|
92
|
+
return teamsfx_api_1.err(updateWebAppInfoRes.error);
|
|
93
|
+
const activeResourcePlugins = solutionSettings.activeResourcePlugins;
|
|
94
|
+
if (!activeResourcePlugins.includes(this.name))
|
|
95
|
+
activeResourcePlugins.push(this.name);
|
|
96
|
+
return teamsfx_api_1.ok([]);
|
|
97
|
+
}
|
|
98
|
+
async deploy(ctx, inputs, envInfo, tokenProvider) {
|
|
99
|
+
const buildRes = await this.spfxPluginImpl.buildSPPackage(ctx, inputs);
|
|
100
|
+
if (buildRes.isErr()) {
|
|
101
|
+
return buildRes;
|
|
102
|
+
}
|
|
103
|
+
return await this.spfxPluginImpl.deploy(ctx, inputs, tokenProvider);
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
tslib_1.__decorate([
|
|
107
|
+
lib_1.hooks([CommonErrorHandlerMW_1.CommonErrorHandlerMW({ telemetry: { component: constants_1.BuiltInFeaturePluginNames.spfx } })]),
|
|
108
|
+
tslib_1.__metadata("design:type", Function),
|
|
109
|
+
tslib_1.__metadata("design:paramtypes", [Object, Object]),
|
|
110
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
111
|
+
], SPFxPluginV3.prototype, "addInstance", null);
|
|
112
|
+
tslib_1.__decorate([
|
|
113
|
+
lib_1.hooks([CommonErrorHandlerMW_1.CommonErrorHandlerMW({ telemetry: { component: constants_1.BuiltInFeaturePluginNames.spfx } })]),
|
|
114
|
+
tslib_1.__metadata("design:type", Function),
|
|
115
|
+
tslib_1.__metadata("design:paramtypes", [Object, Object, Object, Object]),
|
|
116
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
117
|
+
], SPFxPluginV3.prototype, "deploy", null);
|
|
118
|
+
SPFxPluginV3 = tslib_1.__decorate([
|
|
119
|
+
typedi_1.Service(constants_1.BuiltInFeaturePluginNames.spfx)
|
|
120
|
+
], SPFxPluginV3);
|
|
121
|
+
exports.SPFxPluginV3 = SPFxPluginV3;
|
|
122
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/plugins/resource/spfx/v3/index.ts"],"names":[],"mappings":";;;;AAAA,+CAA8C;AAC9C,wDAcgC;AAChC,mCAAiC;AACjC,2FAAwF;AACxF,0EAAuF;AACvF,uGAAoG;AACpG,qEAAqE;AACrE,mCAAgD;AAChD,mDAA6B;AAC7B,kDAK4B;AAE5B,qCAA0C;AAC1C,kDAAsD;AACtD,mDAA6B;AAG7B,IAAa,YAAY,GAAzB,MAAa,YAAY;IAAzB;QACE,SAAI,GAAG,qCAAyB,CAAC,IAAI,CAAC;QACtC,gBAAW,GAAG,MAAM,CAAC;QACrB,gBAAW,GAAG,6BAA6B,CAAC;QAE5C,mBAAc,GAAmB,IAAI,uBAAc,EAAE,CAAC;IAkHxD,CAAC;IAhHC,KAAK,CAAC,0BAA0B,CAC9B,GAAe,EACf,MAAc;QAEd,MAAM,kBAAkB,GAAG,IAAI,uBAAS,CAAC;YACvC,IAAI,EAAE,OAAO;SACd,CAAC,CAAC;QAEH,MAAM,mBAA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AAC,EAAE,SAAS,EAAE,EAAE,SAAS,EAAE,qCAAyB,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC;;;;0CAY3F;AAtHU,YAAY;IADxB,gBAAO,CAAC,qCAAyB,CAAC,IAAI,CAAC;GAC3B,YAAY,CAuHxB;AAvHY,oCAAY"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FxError, Result, TokenProvider, v2, v3 } from "@microsoft/teamsfx-api";
|
|
2
|
+
export declare class SPFxPluginImpl {
|
|
3
|
+
scaffold(ctx: v3.ContextWithManifestProvider, inputs: v2.InputsWithProjectPath, componentId: string): Promise<Result<any, FxError>>;
|
|
4
|
+
buildSPPackage(ctx: v2.Context, inputs: v2.InputsWithProjectPath): Promise<Result<any, FxError>>;
|
|
5
|
+
deploy(ctx: v2.Context, inputs: v2.InputsWithProjectPath, tokenProvider: TokenProvider): Promise<Result<any, FxError>>;
|
|
6
|
+
private getAppID;
|
|
7
|
+
private getTenant;
|
|
8
|
+
private static findGulpCommand;
|
|
9
|
+
private getPackage;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/resource/spfx/v3/plugin.ts"],"names":[],"mappings":"AAwBA,OAAO,EAGL,OAAO,EAGP,MAAM,EACN,aAAa,EAEb,EAAE,EACF,EAAE,EACH,MAAM,wBAAwB,CAAC;AAMhC,qBAAa,cAAc;IACnB,QAAQ,CACZ,GAAG,EAAE,EAAE,CAAC,2BAA2B,EACnC,MAAM,EAAE,EAAE,CAAC,qBAAqB,EAChC,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,MAAM,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IAgK1B,cAAc,CAClB,GAAG,EAAE,EAAE,CAAC,OAAO,EACf,MAAM,EAAE,EAAE,CAAC,qBAAqB,GAC/B,OAAO,CAAC,MAAM,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IAuD1B,MAAM,CACV,GAAG,EAAE,EAAE,CAAC,OAAO,EACf,MAAM,EAAE,EAAE,CAAC,qBAAqB,EAChC,aAAa,EAAE,aAAa,GAC3B,OAAO,CAAC,MAAM,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;YAgHlB,QAAQ;YAMR,SAAS;mBA4BF,eAAe;YAmBtB,UAAU;CAKzB"}
|
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SPFxPluginImpl = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const __1 = require("../../../..");
|
|
6
|
+
const constants_1 = require("../../appstudio/constants");
|
|
7
|
+
const error_1 = require("../error");
|
|
8
|
+
const constants_2 = require("../utils/constants");
|
|
9
|
+
const lodash_1 = tslib_1.__importDefault(require("lodash"));
|
|
10
|
+
const questions_1 = require("../utils/questions");
|
|
11
|
+
const utils_1 = require("../utils/utils");
|
|
12
|
+
const path_1 = tslib_1.__importDefault(require("path"));
|
|
13
|
+
const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
|
|
14
|
+
const teamsfx_api_1 = require("@microsoft/teamsfx-api");
|
|
15
|
+
const progress_helper_1 = require("../utils/progress-helper");
|
|
16
|
+
const util = tslib_1.__importStar(require("util"));
|
|
17
|
+
const spoClient_1 = require("../spoClient");
|
|
18
|
+
const axios_1 = tslib_1.__importDefault(require("axios"));
|
|
19
|
+
class SPFxPluginImpl {
|
|
20
|
+
async scaffold(ctx, inputs, componentId) {
|
|
21
|
+
var _a;
|
|
22
|
+
try {
|
|
23
|
+
const webpartName = inputs[questions_1.SPFXQuestionNames.webpart_name];
|
|
24
|
+
const componentName = utils_1.Utils.normalizeComponentName(webpartName);
|
|
25
|
+
const componentNameCamelCase = lodash_1.default.camelCase(componentName);
|
|
26
|
+
const componentClassName = `${componentName}WebPart`;
|
|
27
|
+
const componentStrings = componentClassName + "Strings";
|
|
28
|
+
const libraryName = lodash_1.default.kebabCase((_a = ctx.projectSetting) === null || _a === void 0 ? void 0 : _a.appName);
|
|
29
|
+
let componentAlias = componentClassName;
|
|
30
|
+
if (componentClassName.length > constants_2.Constants.MAX_ALIAS_LENGTH) {
|
|
31
|
+
componentAlias = componentClassName.substring(0, constants_2.Constants.MAX_ALIAS_LENGTH);
|
|
32
|
+
}
|
|
33
|
+
let componentClassNameKebabCase = lodash_1.default.kebabCase(componentClassName);
|
|
34
|
+
if (componentClassNameKebabCase.length > constants_2.Constants.MAX_BUNDLE_NAME_LENGTH) {
|
|
35
|
+
componentClassNameKebabCase = componentClassNameKebabCase.substring(0, constants_2.Constants.MAX_BUNDLE_NAME_LENGTH);
|
|
36
|
+
const lastCharacterIndex = componentClassNameKebabCase.length - 1;
|
|
37
|
+
if (componentClassNameKebabCase[lastCharacterIndex] === "-") {
|
|
38
|
+
componentClassNameKebabCase = componentClassNameKebabCase.substring(0, lastCharacterIndex);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
const outputFolderPath = `${inputs.projectPath}/SPFx`;
|
|
42
|
+
await fs_extra_1.default.mkdir(outputFolderPath);
|
|
43
|
+
// teams folder
|
|
44
|
+
const teamsDir = `${outputFolderPath}/teams`;
|
|
45
|
+
const templateFolder = path_1.default.join(__1.getTemplatesFolder(), "plugins", "resource", "spfx");
|
|
46
|
+
await fs_extra_1.default.mkdir(teamsDir);
|
|
47
|
+
await fs_extra_1.default.copyFile(path_1.default.resolve(templateFolder, "./webpart/base/images/color.png"), `${teamsDir}/${componentId}_color.png`);
|
|
48
|
+
await fs_extra_1.default.copyFile(path_1.default.resolve(templateFolder, "./webpart/base/images/outline.png"), `${teamsDir}/${componentId}_outline.png`);
|
|
49
|
+
// src folder
|
|
50
|
+
const srcDir = `${outputFolderPath}/src`;
|
|
51
|
+
await fs_extra_1.default.mkdir(srcDir);
|
|
52
|
+
await fs_extra_1.default.copyFile(path_1.default.resolve(templateFolder, "./solution/src/index.ts"), `${srcDir}/index.ts`);
|
|
53
|
+
switch (inputs[questions_1.SPFXQuestionNames.framework_type]) {
|
|
54
|
+
case constants_2.Constants.FRAMEWORK_NONE:
|
|
55
|
+
fs_extra_1.default.mkdirSync(`${srcDir}/webparts/${componentNameCamelCase}`, {
|
|
56
|
+
recursive: true,
|
|
57
|
+
});
|
|
58
|
+
await fs_extra_1.default.copyFile(path_1.default.resolve(templateFolder, "./webpart/none/{componentClassName}.module.scss"), `${srcDir}/webparts/${componentNameCamelCase}/${componentClassName}.module.scss`);
|
|
59
|
+
await fs_extra_1.default.copyFile(path_1.default.resolve(templateFolder, "./webpart/none/{componentClassName}.ts"), `${srcDir}/webparts/${componentNameCamelCase}/${componentClassName}.ts`);
|
|
60
|
+
await fs_extra_1.default.copyFile(path_1.default.resolve(templateFolder, "./webpart/none/package.json"), `${outputFolderPath}/package.json`);
|
|
61
|
+
break;
|
|
62
|
+
case constants_2.Constants.FRAMEWORK_REACT:
|
|
63
|
+
const componentDir = `${srcDir}/webparts/${componentNameCamelCase}/components`;
|
|
64
|
+
fs_extra_1.default.mkdirSync(componentDir, { recursive: true });
|
|
65
|
+
await fs_extra_1.default.copyFile(path_1.default.resolve(templateFolder, "./webpart/react/{componentClassName}.ts"), `${srcDir}/webparts/${componentNameCamelCase}/${componentClassName}.ts`);
|
|
66
|
+
await fs_extra_1.default.copyFile(path_1.default.resolve(templateFolder, "./webpart/react/components/{componentName}.module.scss"), `${componentDir}/${componentName}.module.scss`);
|
|
67
|
+
await fs_extra_1.default.copyFile(path_1.default.resolve(templateFolder, "./webpart/react/components/{componentName}.tsx"), `${componentDir}/${componentName}.tsx`);
|
|
68
|
+
await fs_extra_1.default.copyFile(path_1.default.resolve(templateFolder, "./webpart/react/components/I{componentName}Props.ts"), `${componentDir}/I${componentName}Props.ts`);
|
|
69
|
+
await fs_extra_1.default.copyFile(path_1.default.resolve(templateFolder, "./webpart/react/package.json"), `${outputFolderPath}/package.json`);
|
|
70
|
+
break;
|
|
71
|
+
}
|
|
72
|
+
await fs_extra_1.default.copy(path_1.default.resolve(templateFolder, "./webpart/base/loc"), `${srcDir}/webparts/${componentNameCamelCase}/loc`);
|
|
73
|
+
await fs_extra_1.default.copy(path_1.default.resolve(templateFolder, "./webpart/base/{componentClassName}.manifest.json"), `${srcDir}/webparts/${componentNameCamelCase}/${componentClassName}.manifest.json`);
|
|
74
|
+
// config folder
|
|
75
|
+
await fs_extra_1.default.copy(path_1.default.resolve(templateFolder, "./solution/config"), `${outputFolderPath}/config`);
|
|
76
|
+
// Other files
|
|
77
|
+
await fs_extra_1.default.copyFile(path_1.default.resolve(templateFolder, "./solution/README.md"), `${outputFolderPath}/README.md`);
|
|
78
|
+
await fs_extra_1.default.copyFile(path_1.default.resolve(templateFolder, "./solution/_gitignore"), `${outputFolderPath}/.gitignore`);
|
|
79
|
+
await fs_extra_1.default.copyFile(path_1.default.resolve(templateFolder, "./solution/gulpfile.js"), `${outputFolderPath}/gulpfile.js`);
|
|
80
|
+
await fs_extra_1.default.copyFile(path_1.default.resolve(templateFolder, "./solution/tsconfig.json"), `${outputFolderPath}/tsconfig.json`);
|
|
81
|
+
await fs_extra_1.default.copyFile(path_1.default.resolve(templateFolder, "./solution/tslint.json"), `${outputFolderPath}/tslint.json`);
|
|
82
|
+
// Configure placeholders
|
|
83
|
+
const replaceMap = new Map();
|
|
84
|
+
replaceMap.set(constants_2.PlaceHolders.componentName, componentName);
|
|
85
|
+
replaceMap.set(constants_2.PlaceHolders.componentNameCamelCase, componentNameCamelCase);
|
|
86
|
+
replaceMap.set(constants_2.PlaceHolders.componentClassName, componentClassName);
|
|
87
|
+
replaceMap.set(constants_2.PlaceHolders.componentStrings, componentStrings);
|
|
88
|
+
replaceMap.set(constants_2.PlaceHolders.libraryName, libraryName);
|
|
89
|
+
replaceMap.set(constants_2.PlaceHolders.componentId, componentId);
|
|
90
|
+
replaceMap.set(constants_2.PlaceHolders.componentAlias, componentAlias);
|
|
91
|
+
replaceMap.set(constants_2.PlaceHolders.componentDescription, inputs[questions_1.SPFXQuestionNames.webpart_desp]);
|
|
92
|
+
replaceMap.set(constants_2.PlaceHolders.componentNameUnescaped, webpartName);
|
|
93
|
+
replaceMap.set(constants_2.PlaceHolders.componentClassNameKebabCase, componentClassNameKebabCase);
|
|
94
|
+
const appDirectory = await __1.getAppDirectory(inputs.projectPath);
|
|
95
|
+
await utils_1.Utils.configure(outputFolderPath, replaceMap);
|
|
96
|
+
await utils_1.Utils.configure(path_1.default.join(appDirectory, constants_1.MANIFEST_TEMPLATE), replaceMap);
|
|
97
|
+
await utils_1.Utils.configure(path_1.default.join(appDirectory, constants_1.MANIFEST_LOCAL), replaceMap);
|
|
98
|
+
return teamsfx_api_1.ok(undefined);
|
|
99
|
+
}
|
|
100
|
+
catch (error) {
|
|
101
|
+
return teamsfx_api_1.err(error_1.ScaffoldError(error));
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
async buildSPPackage(ctx, inputs) {
|
|
105
|
+
var _a;
|
|
106
|
+
const progressHandler = await progress_helper_1.ProgressHelper.startPreDeployProgressHandler(ctx.userInteraction);
|
|
107
|
+
if (inputs.platform === teamsfx_api_1.Platform.VSCode) {
|
|
108
|
+
ctx.logProvider.outputChannel.show();
|
|
109
|
+
}
|
|
110
|
+
try {
|
|
111
|
+
const workspacePath = `${inputs.projectPath}/SPFx`;
|
|
112
|
+
await (progressHandler === null || progressHandler === void 0 ? void 0 : progressHandler.next(constants_2.PreDeployProgressMessage.NpmInstall));
|
|
113
|
+
await utils_1.Utils.execute(`npm install`, "SPFx", workspacePath, ctx.logProvider, true);
|
|
114
|
+
const gulpCommand = await SPFxPluginImpl.findGulpCommand(workspacePath);
|
|
115
|
+
await (progressHandler === null || progressHandler === void 0 ? void 0 : progressHandler.next(constants_2.PreDeployProgressMessage.GulpBundle));
|
|
116
|
+
await utils_1.Utils.execute(`${gulpCommand} bundle --ship --no-color`, "SPFx", workspacePath, ctx.logProvider, true);
|
|
117
|
+
await (progressHandler === null || progressHandler === void 0 ? void 0 : progressHandler.next(constants_2.PreDeployProgressMessage.GulpPackage));
|
|
118
|
+
await utils_1.Utils.execute(`${gulpCommand} package-solution --ship --no-color`, "SPFx", workspacePath, ctx.logProvider, true);
|
|
119
|
+
await progress_helper_1.ProgressHelper.endPreDeployProgress(true);
|
|
120
|
+
const sharepointPackage = await this.getPackage(inputs.projectPath);
|
|
121
|
+
if (!(await fs_extra_1.default.pathExists(sharepointPackage))) {
|
|
122
|
+
throw error_1.NoSPPackageError(sharepointPackage);
|
|
123
|
+
}
|
|
124
|
+
const dir = path_1.default.normalize(path_1.default.parse(sharepointPackage).dir);
|
|
125
|
+
if (inputs.platform === teamsfx_api_1.Platform.CLI) {
|
|
126
|
+
const guidance = [
|
|
127
|
+
{
|
|
128
|
+
content: "Success: SharePoint package successfully built at ",
|
|
129
|
+
color: teamsfx_api_1.Colors.BRIGHT_GREEN,
|
|
130
|
+
},
|
|
131
|
+
{ content: dir, color: teamsfx_api_1.Colors.BRIGHT_MAGENTA },
|
|
132
|
+
];
|
|
133
|
+
ctx.userInteraction.showMessage("info", guidance, false);
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
const guidance = util.format(__1.getStrings().plugins.SPFx.buildNotice, dir);
|
|
137
|
+
(_a = ctx.userInteraction) === null || _a === void 0 ? void 0 : _a.showMessage("info", guidance, false, "OK");
|
|
138
|
+
}
|
|
139
|
+
return teamsfx_api_1.ok(undefined);
|
|
140
|
+
}
|
|
141
|
+
catch (error) {
|
|
142
|
+
await progress_helper_1.ProgressHelper.endPreDeployProgress(false);
|
|
143
|
+
return teamsfx_api_1.err(error_1.BuildSPPackageError(error));
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
async deploy(ctx, inputs, tokenProvider) {
|
|
147
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
148
|
+
const progressHandler = await progress_helper_1.ProgressHelper.startDeployProgressHandler(ctx.userInteraction);
|
|
149
|
+
let success = false;
|
|
150
|
+
try {
|
|
151
|
+
const tenant = await this.getTenant(tokenProvider);
|
|
152
|
+
if (tenant.isErr()) {
|
|
153
|
+
return tenant;
|
|
154
|
+
}
|
|
155
|
+
spoClient_1.SPOClient.setBaseUrl(tenant.value);
|
|
156
|
+
const spoToken = await ((_a = tokenProvider.sharepointTokenProvider) === null || _a === void 0 ? void 0 : _a.getAccessToken());
|
|
157
|
+
if (!spoToken) {
|
|
158
|
+
return teamsfx_api_1.err(error_1.GetSPOTokenFailedError());
|
|
159
|
+
}
|
|
160
|
+
let appCatalogSite = await spoClient_1.SPOClient.getAppCatalogSite(spoToken);
|
|
161
|
+
if (appCatalogSite) {
|
|
162
|
+
spoClient_1.SPOClient.setBaseUrl(appCatalogSite);
|
|
163
|
+
}
|
|
164
|
+
else {
|
|
165
|
+
const res = await ((_b = ctx.userInteraction) === null || _b === void 0 ? void 0 : _b.showMessage("warn", util.format(__1.getStrings().plugins.SPFx.createAppCatalogNotice, tenant.value), true, "OK", constants_2.Constants.READ_MORE));
|
|
166
|
+
const confirm = (res === null || res === void 0 ? void 0 : res.isOk()) ? res.value : undefined;
|
|
167
|
+
switch (confirm) {
|
|
168
|
+
case "OK":
|
|
169
|
+
try {
|
|
170
|
+
await (progressHandler === null || progressHandler === void 0 ? void 0 : progressHandler.next(constants_2.DeployProgressMessage.CreateSPAppCatalog));
|
|
171
|
+
await spoClient_1.SPOClient.createAppCatalog(spoToken);
|
|
172
|
+
}
|
|
173
|
+
catch (e) {
|
|
174
|
+
return teamsfx_api_1.err(error_1.CreateAppCatalogFailedError(e));
|
|
175
|
+
}
|
|
176
|
+
let retry = 0;
|
|
177
|
+
appCatalogSite = await spoClient_1.SPOClient.getAppCatalogSite(spoToken);
|
|
178
|
+
while (appCatalogSite == null && retry < constants_2.Constants.APP_CATALOG_MAX_TIMES) {
|
|
179
|
+
(_c = ctx.logProvider) === null || _c === void 0 ? void 0 : _c.warning(`No tenant app catalog found, retry: ${retry}`);
|
|
180
|
+
await utils_1.sleep(constants_2.Constants.APP_CATALOG_REFRESH_TIME);
|
|
181
|
+
appCatalogSite = await spoClient_1.SPOClient.getAppCatalogSite(spoToken);
|
|
182
|
+
retry += 1;
|
|
183
|
+
}
|
|
184
|
+
if (appCatalogSite) {
|
|
185
|
+
spoClient_1.SPOClient.setBaseUrl(appCatalogSite);
|
|
186
|
+
(_d = ctx.logProvider) === null || _d === void 0 ? void 0 : _d.info(`Sharepoint tenant app catalog ${appCatalogSite} created, wait for a few minutes to be active.`);
|
|
187
|
+
await utils_1.sleep(constants_2.Constants.APP_CATALOG_ACTIVE_TIME);
|
|
188
|
+
}
|
|
189
|
+
else {
|
|
190
|
+
return teamsfx_api_1.err(error_1.CreateAppCatalogFailedError(new Error("Cannot get app catalog site url after creation. You may need wait a few minutes and retry.")));
|
|
191
|
+
}
|
|
192
|
+
break;
|
|
193
|
+
case constants_2.Constants.READ_MORE:
|
|
194
|
+
(_e = ctx.userInteraction) === null || _e === void 0 ? void 0 : _e.openUrl(constants_2.Constants.CREATE_APP_CATALOG_GUIDE);
|
|
195
|
+
return teamsfx_api_1.ok(teamsfx_api_1.UserCancelError);
|
|
196
|
+
default:
|
|
197
|
+
return teamsfx_api_1.ok(undefined);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
const appPackage = await this.getPackage(inputs.projectPath);
|
|
201
|
+
if (!(await fs_extra_1.default.pathExists(appPackage))) {
|
|
202
|
+
return teamsfx_api_1.err(error_1.NoSPPackageError(appPackage));
|
|
203
|
+
}
|
|
204
|
+
const fileName = path_1.default.parse(appPackage).base;
|
|
205
|
+
const bytes = await fs_extra_1.default.readFile(appPackage);
|
|
206
|
+
try {
|
|
207
|
+
await (progressHandler === null || progressHandler === void 0 ? void 0 : progressHandler.next(constants_2.DeployProgressMessage.UploadAndDeploy));
|
|
208
|
+
await spoClient_1.SPOClient.uploadAppPackage(spoToken, fileName, bytes);
|
|
209
|
+
}
|
|
210
|
+
catch (e) {
|
|
211
|
+
if (((_f = e.response) === null || _f === void 0 ? void 0 : _f.status) === 403) {
|
|
212
|
+
(_g = ctx.userInteraction) === null || _g === void 0 ? void 0 : _g.showMessage("error", util.format(__1.getStrings().plugins.SPFx.deployFailedNotice, appCatalogSite), false, "OK");
|
|
213
|
+
return teamsfx_api_1.err(error_1.InsufficientPermissionError(appCatalogSite));
|
|
214
|
+
}
|
|
215
|
+
else {
|
|
216
|
+
return teamsfx_api_1.err(error_1.UploadAppPackageFailedError(e));
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
const appID = await this.getAppID(inputs.projectPath);
|
|
220
|
+
await spoClient_1.SPOClient.deployAppPackage(spoToken, appID);
|
|
221
|
+
const guidance = util.format(__1.getStrings().plugins.SPFx.deployNotice, appPackage, appCatalogSite, appCatalogSite);
|
|
222
|
+
if (inputs.platform === teamsfx_api_1.Platform.CLI) {
|
|
223
|
+
(_h = ctx.userInteraction) === null || _h === void 0 ? void 0 : _h.showMessage("info", guidance, false);
|
|
224
|
+
}
|
|
225
|
+
else {
|
|
226
|
+
(_j = ctx.userInteraction) === null || _j === void 0 ? void 0 : _j.showMessage("info", guidance, false, "OK");
|
|
227
|
+
}
|
|
228
|
+
success = true;
|
|
229
|
+
return teamsfx_api_1.ok(undefined);
|
|
230
|
+
}
|
|
231
|
+
finally {
|
|
232
|
+
await progress_helper_1.ProgressHelper.endDeployProgress(success);
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
async getAppID(root) {
|
|
236
|
+
const solutionConfig = await fs_extra_1.default.readJson(`${root}/SPFx/config/package-solution.json`);
|
|
237
|
+
const appID = solutionConfig["solution"]["id"];
|
|
238
|
+
return appID;
|
|
239
|
+
}
|
|
240
|
+
async getTenant(tokenProvider) {
|
|
241
|
+
var _a, _b;
|
|
242
|
+
const graphToken = await ((_a = tokenProvider.graphTokenProvider) === null || _a === void 0 ? void 0 : _a.getAccessToken());
|
|
243
|
+
if (!graphToken) {
|
|
244
|
+
return teamsfx_api_1.err(error_1.GetGraphTokenFailedError());
|
|
245
|
+
}
|
|
246
|
+
const tokenJson = await ((_b = tokenProvider.graphTokenProvider) === null || _b === void 0 ? void 0 : _b.getJsonObject());
|
|
247
|
+
const username = tokenJson.unique_name;
|
|
248
|
+
const instance = axios_1.default.create({
|
|
249
|
+
baseURL: "https://graph.microsoft.com/v1.0",
|
|
250
|
+
});
|
|
251
|
+
instance.defaults.headers.common["Authorization"] = `Bearer ${graphToken}`;
|
|
252
|
+
let tenant = "";
|
|
253
|
+
try {
|
|
254
|
+
const res = await instance.get("/sites/root?$select=webUrl");
|
|
255
|
+
if (res && res.data && res.data.webUrl) {
|
|
256
|
+
tenant = res.data.webUrl;
|
|
257
|
+
}
|
|
258
|
+
else {
|
|
259
|
+
return teamsfx_api_1.err(error_1.GetTenantFailedError(username));
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
catch (e) {
|
|
263
|
+
return teamsfx_api_1.err(error_1.GetTenantFailedError(username, e));
|
|
264
|
+
}
|
|
265
|
+
return teamsfx_api_1.ok(tenant);
|
|
266
|
+
}
|
|
267
|
+
static async findGulpCommand(rootPath) {
|
|
268
|
+
let gulpCommand;
|
|
269
|
+
const platform = process.platform;
|
|
270
|
+
if (platform === "win32" &&
|
|
271
|
+
(await fs_extra_1.default.pathExists(path_1.default.join(rootPath, "node_modules", ".bin", "gulp.cmd")))) {
|
|
272
|
+
gulpCommand = path_1.default.join(".", "node_modules", ".bin", "gulp.cmd");
|
|
273
|
+
}
|
|
274
|
+
else if ((platform === "linux" || platform === "darwin") &&
|
|
275
|
+
(await fs_extra_1.default.pathExists(path_1.default.join(rootPath, "node_modules", ".bin", "gulp")))) {
|
|
276
|
+
gulpCommand = path_1.default.join(".", "node_modules", ".bin", "gulp");
|
|
277
|
+
}
|
|
278
|
+
else {
|
|
279
|
+
gulpCommand = "gulp";
|
|
280
|
+
}
|
|
281
|
+
return gulpCommand;
|
|
282
|
+
}
|
|
283
|
+
async getPackage(root) {
|
|
284
|
+
const solutionConfig = await fs_extra_1.default.readJson(`${root}/SPFx/config/package-solution.json`);
|
|
285
|
+
const sharepointPackage = `${root}/SPFx/sharepoint/${solutionConfig.paths.zippedPackage}`;
|
|
286
|
+
return sharepointPackage;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
exports.SPFxPluginImpl = SPFxPluginImpl;
|
|
290
|
+
//# sourceMappingURL=plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../../../../src/plugins/resource/spfx/v3/plugin.ts"],"names":[],"mappings":";;;;AAAA,mCAA8E;AAC9E,yDAA8E;AAC9E,oCAUkB;AAClB,kDAK4B;AAC5B,4DAA4B;AAC5B,kDAAuD;AACvD,0CAA8C;AAC9C,wDAAwB;AACxB,gEAA0B;AAC1B,wDAWgC;AAChC,8DAA0D;AAC1D,mDAA6B;AAC7B,4CAAyC;AACzC,0DAA0B;AAE1B,MAAa,cAAc;IACzB,KAAK,CAAC,QAAQ,CACZ,GAAmC,EACnC,MAAgC,EAChC,WAAmB;;QAEnB,IAAI;YACF,MAAM,WAAW,GAAG,MAAM,CAAC,6BAAiB,CAAC,YAAY,CAAW,CAAC;YACrE,MAAM,aAAa,GAAG,aAAK,CAAC,sBAAsB,CAAC,WAAW,CAAC,CAAC;YAChE,MAAM,sBAAsB,GAAG,gBAAM,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC;YAC/D,MAAM,kBAAkB,GAAG,GAAG,aAAa,SAAS,CAAC;YACrD,MAAM,gBAAgB,GAAG,kBAAkB,GAAG,SAAS,CAAC;YACxD,MAAM,WAAW,GAAG,gBAAM,CAAC,SAAS,CAAC,MAAA,GAAG,CAAC,cAAc,0CAAE,OAAO,CAAC,CAAC;YAClE,IAAI,cAAc,GAAG,kBAAkB,CAAC;YACxC,IAAI,kBAAkB,CAAC,MAAM,GAAG,qBAAS,CAAC,gBAAgB,EAAE;gBAC1D,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C,CAAC,EAC9E;YACA,WAAW,GAAG,cAAI,CAAC,IAAI,CAAC,GAAG,EAAE,cAAc,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;SAClE;aAAM,IACL,CAAC,QAAQ,KAAK,OAAO,IAAI,QAAQ,KAAK,QAAQ,CAAC;YAC/C,CAAC,MAAM,kBAAE,CAAC,UAAU,CAAC,cAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,EAC1E;YACA,WAAW,GAAG,cAAI,CAAC,IAAI,CAAC,GAAG,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;SAC9D;aAAM;YACL,WAAW,GAAG,MAAM,CAAC;SACtB;QACD,OAAO,WAAW,CAAC;IACrB,CAAC;IAEO,KAAK,CAAC,UAAU,CAAC,IAAY;QACnC,MAAM,cAAc,GAAG,MAAM,kBAAE,CAAC,QAAQ,CAAC,GAAG,IAAI,oCAAoC,CAAC,CAAC;QACtF,MAAM,iBAAiB,GAAG,GAAG,IAAI,oBAAoB,cAAc,CAAC,KAAK,CAAC,aAAa,EAAE,CAAC;QAC1F,OAAO,iBAAiB,CAAC;IAC3B,CAAC;CACF;AA7YD,wCA6YC"}
|
|
@@ -2,18 +2,21 @@ import { FxError, Inputs, QTreeNode, Result, TokenProvider, v2, v3, Void } from
|
|
|
2
2
|
import { SqlConfig } from "../config";
|
|
3
3
|
import { SqlClient } from "../sqlClient";
|
|
4
4
|
import { ManagementClient } from "../managementClient";
|
|
5
|
-
export declare class SqlPluginV3 implements v3.
|
|
5
|
+
export declare class SqlPluginV3 implements v3.PluginV3 {
|
|
6
6
|
name: string;
|
|
7
7
|
displayName: string;
|
|
8
8
|
totalFirewallRuleCount: number;
|
|
9
9
|
config: SqlConfig;
|
|
10
|
-
|
|
11
|
-
generateNewSqlServerBicep(ctx: v3.ContextWithManifestProvider): Promise<Result<
|
|
12
|
-
generateNewDatabaseBicep(
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
generateBicep(ctx: v3.ContextWithManifestProvider, inputs: v3.AddFeatureInputs): Promise<Result<v3.BicepTemplate[], FxError>>;
|
|
11
|
+
generateNewSqlServerBicep(ctx: v3.ContextWithManifestProvider, inputs: v3.AddFeatureInputs): Promise<Result<v3.BicepTemplate[], FxError>>;
|
|
12
|
+
generateNewDatabaseBicep(): Promise<Result<v3.BicepTemplate[], FxError>>;
|
|
13
|
+
addInstance(ctx: v3.ContextWithManifestProvider, inputs: v2.InputsWithProjectPath): Promise<Result<string[], FxError>>;
|
|
14
|
+
updateBicep(ctx: v3.ContextWithManifestProvider, inputs: v3.UpdateInputs): Promise<Result<v3.BicepTemplate[], FxError>>;
|
|
15
15
|
getQuestionsForProvision(ctx: v2.Context, inputs: Inputs, envInfo: v2.DeepReadonly<v3.EnvInfoV3>, tokenProvider: TokenProvider): Promise<Result<QTreeNode | undefined, FxError>>;
|
|
16
16
|
getRuleName(suffix: number): string;
|
|
17
|
+
private removeDatabases;
|
|
18
|
+
private parseLoginToken;
|
|
19
|
+
provisionResource(ctx: v2.Context, inputs: v2.InputsWithProjectPath, envInfo: v3.EnvInfoV3, tokenProvider: TokenProvider): Promise<Result<Void, FxError>>;
|
|
17
20
|
configureResource(ctx: v2.Context, inputs: v2.InputsWithProjectPath, envInfo: v3.EnvInfoV3, tokenProvider: TokenProvider, telemetryProps?: any): Promise<Result<Void, FxError>>;
|
|
18
21
|
addDatabaseUser(ctx: v2.Context, sqlClient: SqlClient, managementClient: ManagementClient): Promise<void>;
|
|
19
22
|
private CheckAndSetAadAdmin;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/resource/sql/v3/index.ts"],"names":[],"mappings":"AAGA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/resource/sql/v3/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAGL,OAAO,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