@microsoft/teamsfx-core 1.7.0 → 1.7.1-alpha.42a29d71b.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 +3 -1
- package/build/common/constants.d.ts.map +1 -1
- package/build/common/constants.js +3 -1
- package/build/common/constants.js.map +1 -1
- package/build/common/featureFlags.d.ts +8 -0
- package/build/common/featureFlags.d.ts.map +1 -0
- package/build/common/featureFlags.js +43 -0
- package/build/common/featureFlags.js.map +1 -0
- package/build/common/index.d.ts +4 -3
- package/build/common/index.d.ts.map +1 -1
- package/build/common/index.js +4 -3
- package/build/common/index.js.map +1 -1
- package/build/common/local/localEnvManager.d.ts +1 -1
- package/build/common/local/localEnvManager.d.ts.map +1 -1
- package/build/common/local/localEnvManager.js +1 -1
- package/build/common/local/localEnvManager.js.map +1 -1
- package/build/common/local/localStateHelper.d.ts.map +1 -1
- package/build/common/local/localStateHelper.js +12 -0
- package/build/common/local/localStateHelper.js.map +1 -1
- package/build/common/local/portChecker.d.ts.map +1 -1
- package/build/common/local/portChecker.js +6 -1
- package/build/common/local/portChecker.js.map +1 -1
- package/build/common/projectSettingsHelper.d.ts +1 -1
- package/build/common/projectSettingsHelper.d.ts.map +1 -1
- package/build/common/projectSettingsHelper.js +6 -4
- package/build/common/projectSettingsHelper.js.map +1 -1
- package/build/common/samples-config.json +29 -15
- package/build/common/samples.d.ts +1 -1
- package/build/common/samples.d.ts.map +1 -1
- package/build/common/samples.js +3 -2
- package/build/common/samples.js.map +1 -1
- package/build/common/telemetry.d.ts +9 -0
- package/build/common/telemetry.d.ts.map +1 -1
- package/build/common/telemetry.js +9 -0
- package/build/common/telemetry.js.map +1 -1
- package/build/common/templates-config.json +2 -2
- package/build/common/tools.d.ts +3 -3
- package/build/common/tools.d.ts.map +1 -1
- package/build/common/tools.js +28 -28
- package/build/common/tools.js.map +1 -1
- package/build/core/FxCore.d.ts +3 -2
- package/build/core/FxCore.d.ts.map +1 -1
- package/build/core/FxCore.js +76 -19
- package/build/core/FxCore.js.map +1 -1
- package/build/core/environment.d.ts +1 -1
- package/build/core/environment.d.ts.map +1 -1
- package/build/core/environment.js +6 -1
- package/build/core/environment.js.map +1 -1
- package/build/core/error.d.ts +1 -0
- package/build/core/error.d.ts.map +1 -1
- package/build/core/error.js +5 -1
- package/build/core/error.js.map +1 -1
- package/build/core/globalVars.d.ts +0 -5
- package/build/core/globalVars.d.ts.map +1 -1
- package/build/core/globalVars.js +1 -9
- package/build/core/globalVars.js.map +1 -1
- package/build/core/middleware/aadManifestMigration.d.ts +3 -0
- package/build/core/middleware/aadManifestMigration.d.ts.map +1 -0
- package/build/core/middleware/aadManifestMigration.js +240 -0
- package/build/core/middleware/aadManifestMigration.js.map +1 -0
- package/build/core/middleware/consolidateLocalRemote.d.ts +2 -0
- package/build/core/middleware/consolidateLocalRemote.d.ts.map +1 -1
- package/build/core/middleware/consolidateLocalRemote.js +100 -55
- package/build/core/middleware/consolidateLocalRemote.js.map +1 -1
- package/build/core/middleware/errorHandler.d.ts.map +1 -1
- package/build/core/middleware/errorHandler.js +15 -3
- package/build/core/middleware/errorHandler.js.map +1 -1
- package/build/core/middleware/questionModel.d.ts.map +1 -1
- package/build/core/middleware/questionModel.js +11 -55
- package/build/core/middleware/questionModel.js.map +1 -1
- package/build/core/question.d.ts +2 -8
- package/build/core/question.d.ts.map +1 -1
- package/build/core/question.js +68 -52
- package/build/core/question.js.map +1 -1
- package/build/core/telemetry.d.ts +23 -0
- package/build/core/telemetry.d.ts.map +1 -0
- package/build/core/telemetry.js +46 -0
- package/build/core/telemetry.js.map +1 -0
- package/build/plugins/resource/aad/constants.d.ts +5 -0
- package/build/plugins/resource/aad/constants.d.ts.map +1 -1
- package/build/plugins/resource/aad/constants.js +5 -0
- package/build/plugins/resource/aad/constants.js.map +1 -1
- package/build/plugins/resource/aad/errors.d.ts +2 -0
- package/build/plugins/resource/aad/errors.d.ts.map +1 -1
- package/build/plugins/resource/aad/errors.js +15 -1
- package/build/plugins/resource/aad/errors.js.map +1 -1
- package/build/plugins/resource/aad/index.d.ts +2 -1
- package/build/plugins/resource/aad/index.d.ts.map +1 -1
- package/build/plugins/resource/aad/index.js +23 -0
- package/build/plugins/resource/aad/index.js.map +1 -1
- package/build/plugins/resource/aad/plugin.d.ts +3 -0
- package/build/plugins/resource/aad/plugin.d.ts.map +1 -1
- package/build/plugins/resource/aad/plugin.js +109 -19
- package/build/plugins/resource/aad/plugin.js.map +1 -1
- package/build/plugins/resource/aad/utils/configs.d.ts +2 -1
- package/build/plugins/resource/aad/utils/configs.d.ts.map +1 -1
- package/build/plugins/resource/aad/utils/configs.js +20 -3
- package/build/plugins/resource/aad/utils/configs.js.map +1 -1
- package/build/plugins/resource/aad/v2/index.d.ts +2 -1
- package/build/plugins/resource/aad/v2/index.d.ts.map +1 -1
- package/build/plugins/resource/aad/v2/index.js +3 -0
- package/build/plugins/resource/aad/v2/index.js.map +1 -1
- package/build/plugins/resource/apiconnector/checker.d.ts +7 -0
- package/build/plugins/resource/apiconnector/checker.d.ts.map +1 -0
- package/build/plugins/resource/apiconnector/checker.js +73 -0
- package/build/plugins/resource/apiconnector/checker.js.map +1 -0
- package/build/plugins/resource/apiconnector/config.d.ts +23 -0
- package/build/plugins/resource/apiconnector/config.d.ts.map +1 -0
- package/build/plugins/resource/apiconnector/config.js +5 -0
- package/build/plugins/resource/apiconnector/config.js.map +1 -0
- package/build/plugins/resource/apiconnector/constants.d.ts +25 -1
- package/build/plugins/resource/apiconnector/constants.d.ts.map +1 -1
- package/build/plugins/resource/apiconnector/constants.js +33 -7
- package/build/plugins/resource/apiconnector/constants.js.map +1 -1
- package/build/plugins/resource/apiconnector/depsHandler.d.ts +13 -0
- package/build/plugins/resource/apiconnector/depsHandler.d.ts.map +1 -0
- package/build/plugins/resource/apiconnector/depsHandler.js +93 -0
- package/build/plugins/resource/apiconnector/depsHandler.js.map +1 -0
- package/build/plugins/resource/apiconnector/envHandler.d.ts +6 -4
- package/build/plugins/resource/apiconnector/envHandler.d.ts.map +1 -1
- package/build/plugins/resource/apiconnector/envHandler.js +57 -26
- package/build/plugins/resource/apiconnector/envHandler.js.map +1 -1
- package/build/plugins/resource/apiconnector/errors.d.ts +30 -8
- package/build/plugins/resource/apiconnector/errors.d.ts.map +1 -1
- package/build/plugins/resource/apiconnector/errors.js +35 -9
- package/build/plugins/resource/apiconnector/errors.js.map +1 -1
- package/build/plugins/resource/apiconnector/index.d.ts.map +1 -1
- package/build/plugins/resource/apiconnector/index.js +1 -8
- package/build/plugins/resource/apiconnector/index.js.map +1 -1
- package/build/plugins/resource/apiconnector/plugin.d.ts +16 -2
- package/build/plugins/resource/apiconnector/plugin.d.ts.map +1 -1
- package/build/plugins/resource/apiconnector/plugin.js +259 -37
- package/build/plugins/resource/apiconnector/plugin.js.map +1 -1
- package/build/plugins/resource/apiconnector/questions.d.ts +26 -4
- package/build/plugins/resource/apiconnector/questions.d.ts.map +1 -1
- package/build/plugins/resource/apiconnector/questions.js +103 -26
- package/build/plugins/resource/apiconnector/questions.js.map +1 -1
- package/build/plugins/resource/apiconnector/result.d.ts +16 -3
- package/build/plugins/resource/apiconnector/result.d.ts.map +1 -1
- package/build/plugins/resource/apiconnector/result.js +24 -5
- package/build/plugins/resource/apiconnector/result.js.map +1 -1
- package/build/plugins/resource/apiconnector/sampleHandler.d.ts +3 -3
- package/build/plugins/resource/apiconnector/sampleHandler.d.ts.map +1 -1
- package/build/plugins/resource/apiconnector/sampleHandler.js +14 -4
- package/build/plugins/resource/apiconnector/sampleHandler.js.map +1 -1
- package/build/plugins/resource/apiconnector/telemetry.d.ts +41 -0
- package/build/plugins/resource/apiconnector/telemetry.d.ts.map +1 -0
- package/build/plugins/resource/apiconnector/telemetry.js +69 -0
- package/build/plugins/resource/apiconnector/telemetry.js.map +1 -0
- package/build/plugins/resource/apiconnector/utils.d.ts +14 -20
- package/build/plugins/resource/apiconnector/utils.d.ts.map +1 -1
- package/build/plugins/resource/apiconnector/utils.js +63 -16
- package/build/plugins/resource/apiconnector/utils.js.map +1 -1
- package/build/plugins/resource/appstudio/appStudio.d.ts.map +1 -1
- package/build/plugins/resource/appstudio/appStudio.js +6 -5
- package/build/plugins/resource/appstudio/appStudio.js.map +1 -1
- package/build/plugins/resource/appstudio/constants.d.ts +2 -0
- package/build/plugins/resource/appstudio/constants.d.ts.map +1 -1
- package/build/plugins/resource/appstudio/constants.js +24 -1
- package/build/plugins/resource/appstudio/constants.js.map +1 -1
- package/build/plugins/resource/appstudio/index.d.ts +1 -0
- package/build/plugins/resource/appstudio/index.d.ts.map +1 -1
- package/build/plugins/resource/appstudio/index.js +56 -11
- package/build/plugins/resource/appstudio/index.js.map +1 -1
- package/build/plugins/resource/appstudio/manifestTemplate.d.ts +2 -2
- package/build/plugins/resource/appstudio/manifestTemplate.d.ts.map +1 -1
- package/build/plugins/resource/appstudio/manifestTemplate.js +27 -5
- package/build/plugins/resource/appstudio/manifestTemplate.js.map +1 -1
- package/build/plugins/resource/appstudio/plugin.d.ts +1 -0
- package/build/plugins/resource/appstudio/plugin.d.ts.map +1 -1
- package/build/plugins/resource/appstudio/plugin.js +6 -1
- package/build/plugins/resource/appstudio/plugin.js.map +1 -1
- package/build/plugins/resource/appstudio/utils/telemetry.d.ts +1 -0
- package/build/plugins/resource/appstudio/utils/telemetry.d.ts.map +1 -1
- package/build/plugins/resource/appstudio/utils/telemetry.js +1 -0
- package/build/plugins/resource/appstudio/utils/telemetry.js.map +1 -1
- package/build/plugins/resource/appstudio/v2/index.d.ts +2 -0
- package/build/plugins/resource/appstudio/v2/index.d.ts.map +1 -1
- package/build/plugins/resource/appstudio/v2/index.js +5 -0
- package/build/plugins/resource/appstudio/v2/index.js.map +1 -1
- package/build/plugins/resource/appstudio/v3/index.js +1 -1
- package/build/plugins/resource/appstudio/v3/index.js.map +1 -1
- package/build/plugins/resource/appstudio/v3/plugin.d.ts.map +1 -1
- package/build/plugins/resource/appstudio/v3/plugin.js +5 -0
- package/build/plugins/resource/appstudio/v3/plugin.js.map +1 -1
- package/build/plugins/resource/bot/azureOps.d.ts +3 -2
- package/build/plugins/resource/bot/azureOps.d.ts.map +1 -1
- package/build/plugins/resource/bot/azureOps.js +29 -30
- package/build/plugins/resource/bot/azureOps.js.map +1 -1
- package/build/plugins/resource/bot/clientFactory.d.ts +0 -5
- package/build/plugins/resource/bot/clientFactory.d.ts.map +1 -1
- package/build/plugins/resource/bot/clientFactory.js +1 -29
- package/build/plugins/resource/bot/clientFactory.js.map +1 -1
- package/build/plugins/resource/bot/configs/teamsBotConfig.d.ts +1 -0
- package/build/plugins/resource/bot/configs/teamsBotConfig.d.ts.map +1 -1
- package/build/plugins/resource/bot/configs/teamsBotConfig.js +15 -13
- package/build/plugins/resource/bot/configs/teamsBotConfig.js.map +1 -1
- package/build/plugins/resource/bot/constants.d.ts +8 -9
- package/build/plugins/resource/bot/constants.d.ts.map +1 -1
- package/build/plugins/resource/bot/constants.js +9 -9
- package/build/plugins/resource/bot/constants.js.map +1 -1
- package/build/plugins/resource/bot/errors.d.ts +6 -18
- package/build/plugins/resource/bot/errors.d.ts.map +1 -1
- package/build/plugins/resource/bot/errors.js +16 -39
- package/build/plugins/resource/bot/errors.js.map +1 -1
- package/build/plugins/resource/bot/functionsHostedBot/deployMgr.d.ts +1 -1
- package/build/plugins/resource/bot/functionsHostedBot/deployMgr.d.ts.map +1 -1
- package/build/plugins/resource/bot/functionsHostedBot/deployMgr.js +10 -4
- package/build/plugins/resource/bot/functionsHostedBot/deployMgr.js.map +1 -1
- package/build/plugins/resource/bot/functionsHostedBot/plugin.d.ts.map +1 -1
- package/build/plugins/resource/bot/functionsHostedBot/plugin.js +4 -7
- package/build/plugins/resource/bot/functionsHostedBot/plugin.js.map +1 -1
- package/build/plugins/resource/bot/index.d.ts.map +1 -1
- package/build/plugins/resource/bot/index.js +4 -2
- package/build/plugins/resource/bot/index.js.map +1 -1
- package/build/plugins/resource/bot/languageStrategy.d.ts.map +1 -1
- package/build/plugins/resource/bot/languageStrategy.js +3 -1
- package/build/plugins/resource/bot/languageStrategy.js.map +1 -1
- package/build/plugins/resource/bot/plugin.d.ts.map +1 -1
- package/build/plugins/resource/bot/plugin.js +8 -3
- package/build/plugins/resource/bot/plugin.js.map +1 -1
- package/build/plugins/resource/bot/question.d.ts +5 -3
- package/build/plugins/resource/bot/question.d.ts.map +1 -1
- package/build/plugins/resource/bot/question.js +20 -2
- package/build/plugins/resource/bot/question.js.map +1 -1
- package/build/plugins/resource/bot/resources/messages.d.ts +2 -0
- package/build/plugins/resource/bot/resources/messages.d.ts.map +1 -1
- package/build/plugins/resource/bot/resources/messages.js +8 -0
- package/build/plugins/resource/bot/resources/messages.js.map +1 -1
- package/build/plugins/resource/bot/utils/common.d.ts +1 -0
- package/build/plugins/resource/bot/utils/common.d.ts.map +1 -1
- package/build/plugins/resource/bot/utils/common.js +5 -1
- package/build/plugins/resource/bot/utils/common.js.map +1 -1
- package/build/plugins/resource/bot/utils/zipDeploy.js +1 -1
- package/build/plugins/resource/bot/utils/zipDeploy.js.map +1 -1
- package/build/plugins/resource/bot/v3/index.d.ts.map +1 -1
- package/build/plugins/resource/bot/v3/index.js +2 -1
- package/build/plugins/resource/bot/v3/index.js.map +1 -1
- package/build/plugins/resource/frontend/constants.d.ts +4 -0
- package/build/plugins/resource/frontend/constants.d.ts.map +1 -1
- package/build/plugins/resource/frontend/constants.js +6 -2
- package/build/plugins/resource/frontend/constants.js.map +1 -1
- package/build/plugins/resource/frontend/dotnet/plugin.js +1 -1
- package/build/plugins/resource/frontend/dotnet/plugin.js.map +1 -1
- package/build/plugins/resource/frontend/env.js +2 -2
- package/build/plugins/resource/frontend/env.js.map +1 -1
- package/build/plugins/resource/frontend/ops/deploy.d.ts +3 -5
- package/build/plugins/resource/frontend/ops/deploy.d.ts.map +1 -1
- package/build/plugins/resource/frontend/ops/deploy.js +41 -7
- package/build/plugins/resource/frontend/ops/deploy.js.map +1 -1
- package/build/plugins/resource/frontend/plugin.d.ts.map +1 -1
- package/build/plugins/resource/frontend/plugin.js +5 -6
- package/build/plugins/resource/frontend/plugin.js.map +1 -1
- package/build/plugins/resource/frontend/resources/errors.d.ts +1 -1
- package/build/plugins/resource/frontend/resources/errors.d.ts.map +1 -1
- package/build/plugins/resource/frontend/resources/errors.js +4 -4
- package/build/plugins/resource/frontend/resources/errors.js.map +1 -1
- package/build/plugins/resource/frontend/resources/templateInfo.js +1 -1
- package/build/plugins/resource/frontend/resources/templateInfo.js.map +1 -1
- package/build/plugins/resource/frontend/utils/progress-helper.d.ts +2 -2
- package/build/plugins/resource/frontend/utils/progress-helper.d.ts.map +1 -1
- package/build/plugins/resource/frontend/utils/progress-helper.js +4 -4
- package/build/plugins/resource/frontend/utils/progress-helper.js.map +1 -1
- package/build/plugins/resource/frontend/v3/index.d.ts.map +1 -1
- package/build/plugins/resource/frontend/v3/index.js +10 -13
- package/build/plugins/resource/frontend/v3/index.js.map +1 -1
- package/build/plugins/resource/spfx/depsChecker/yoChecker.d.ts.map +1 -1
- package/build/plugins/resource/spfx/depsChecker/yoChecker.js +6 -0
- package/build/plugins/resource/spfx/depsChecker/yoChecker.js.map +1 -1
- package/build/plugins/resource/spfx/index.d.ts.map +1 -1
- package/build/plugins/resource/spfx/index.js +0 -5
- 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 +59 -133
- package/build/plugins/resource/spfx/plugin.js.map +1 -1
- package/build/plugins/resource/spfx/utils/questions.d.ts.map +1 -1
- package/build/plugins/resource/spfx/utils/questions.js +5 -11
- package/build/plugins/resource/spfx/utils/questions.js.map +1 -1
- package/build/plugins/resource/sql/constants.d.ts +2 -4
- package/build/plugins/resource/sql/constants.d.ts.map +1 -1
- package/build/plugins/resource/sql/constants.js +2 -4
- package/build/plugins/resource/sql/constants.js.map +1 -1
- package/build/plugins/resource/sql/errors.d.ts.map +1 -1
- package/build/plugins/resource/sql/errors.js +29 -29
- package/build/plugins/resource/sql/errors.js.map +1 -1
- package/build/plugins/resource/sql/index.d.ts.map +1 -1
- package/build/plugins/resource/sql/index.js +1 -1
- package/build/plugins/resource/sql/index.js.map +1 -1
- package/build/plugins/resource/sql/plugin.d.ts.map +1 -1
- package/build/plugins/resource/sql/plugin.js +24 -11
- package/build/plugins/resource/sql/plugin.js.map +1 -1
- package/build/plugins/resource/sql/sqlClient.d.ts.map +1 -1
- package/build/plugins/resource/sql/sqlClient.js +7 -10
- package/build/plugins/resource/sql/sqlClient.js.map +1 -1
- package/build/plugins/resource/sql/utils/dialogUtils.d.ts +0 -1
- package/build/plugins/resource/sql/utils/dialogUtils.d.ts.map +1 -1
- package/build/plugins/resource/sql/utils/dialogUtils.js +0 -1
- package/build/plugins/resource/sql/utils/dialogUtils.js.map +1 -1
- package/build/plugins/solution/fx-solution/arm.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/arm.js +15 -9
- package/build/plugins/solution/fx-solution/arm.js.map +1 -1
- package/build/plugins/solution/fx-solution/commonQuestions.js +1 -1
- package/build/plugins/solution/fx-solution/commonQuestions.js.map +1 -1
- package/build/plugins/solution/fx-solution/constants.d.ts +19 -2
- package/build/plugins/solution/fx-solution/constants.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/constants.js +22 -1
- package/build/plugins/solution/fx-solution/constants.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 +1 -46
- 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 +0 -26
- package/build/plugins/solution/fx-solution/debug/util/launchNext.js.map +1 -1
- package/build/plugins/solution/fx-solution/debug/util/tasksNext.js +1 -1
- package/build/plugins/solution/fx-solution/debug/util/tasksNext.js.map +1 -1
- package/build/plugins/solution/fx-solution/index.d.ts +1 -0
- package/build/plugins/solution/fx-solution/index.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/index.js +1 -0
- package/build/plugins/solution/fx-solution/index.js.map +1 -1
- package/build/plugins/solution/fx-solution/question.d.ts +8 -3
- package/build/plugins/solution/fx-solution/question.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/question.js +70 -29
- package/build/plugins/solution/fx-solution/question.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 +31 -8
- package/build/plugins/solution/fx-solution/v2/deploy.js.map +1 -1
- package/build/plugins/solution/fx-solution/v2/executeUserTask.d.ts +2 -1
- package/build/plugins/solution/fx-solution/v2/executeUserTask.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/v2/executeUserTask.js +160 -95
- 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 +123 -65
- 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 +22 -9
- package/build/plugins/solution/fx-solution/v2/provision.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 +9 -1
- package/build/plugins/solution/fx-solution/v2/utils.js.map +1 -1
- package/build/plugins/solution/fx-solution/v3/provision.d.ts +1 -0
- package/build/plugins/solution/fx-solution/v3/provision.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/v3/provision.js +18 -1
- package/build/plugins/solution/fx-solution/v3/provision.js.map +1 -1
- package/package.json +5 -4
- package/resource/aad-manifest-change-logs.md +27 -0
- package/resource/package.nls.json +150 -72
- package/resource/unify-config-change-logs.md +26 -0
- package/templates/core/README.md +46 -0
- package/templates/fallback/blazor-base.csharp.default.zip +0 -0
- package/templates/fallback/bot.csharp.default.zip +0 -0
- package/templates/fallback/bot.js.command-and-response.zip +0 -0
- package/templates/fallback/bot.js.default.zip +0 -0
- package/templates/fallback/bot.js.m365.zip +0 -0
- package/templates/fallback/bot.js.notification-function-base.zip +0 -0
- package/templates/fallback/bot.js.notification-restify.zip +0 -0
- package/templates/fallback/bot.js.notification-trigger-http.zip +0 -0
- package/templates/fallback/bot.js.notification-trigger-timer.zip +0 -0
- package/templates/fallback/bot.ts.command-and-response.zip +0 -0
- package/templates/fallback/bot.ts.default.zip +0 -0
- package/templates/fallback/bot.ts.m365.zip +0 -0
- package/templates/fallback/bot.ts.notification-function-base.zip +0 -0
- package/templates/fallback/bot.ts.notification-restify.zip +0 -0
- package/templates/fallback/bot.ts.notification-trigger-http.zip +0 -0
- package/templates/fallback/bot.ts.notification-trigger-timer.zip +0 -0
- package/templates/fallback/bot.ts.notification.zip +0 -0
- package/templates/fallback/function-base.js.default.zip +0 -0
- package/templates/fallback/function-base.ts.default.zip +0 -0
- package/templates/fallback/function-triggers.js.HTTPTrigger.zip +0 -0
- package/templates/fallback/function-triggers.ts.HTTPTrigger.zip +0 -0
- package/templates/fallback/tab.csharp.default.zip +0 -0
- package/templates/fallback/tab.js.default.zip +0 -0
- package/templates/fallback/tab.js.m365.zip +0 -0
- package/templates/fallback/tab.js.non-sso.zip +0 -0
- package/templates/fallback/tab.ts.default.zip +0 -0
- package/templates/fallback/tab.ts.m365.zip +0 -0
- package/templates/fallback/tab.ts.non-sso.zip +0 -0
- package/templates/plugins/resource/aad/auth/bot/README.md +17 -0
- package/templates/plugins/resource/aad/auth/bot/js/public/auth-end.html +65 -0
- package/templates/plugins/resource/aad/auth/bot/js/public/auth-start.html +177 -0
- package/templates/plugins/resource/aad/auth/bot/js/sso/showUserInfo.js +23 -0
- package/templates/plugins/resource/aad/auth/bot/js/sso/ssoDialog.js +176 -0
- package/templates/plugins/resource/aad/auth/bot/js/sso/teamsSsoBot.js +57 -0
- package/templates/plugins/resource/aad/auth/bot/ts/public/auth-end.html +65 -0
- package/templates/plugins/resource/aad/auth/bot/ts/public/auth-start.html +177 -0
- package/templates/plugins/resource/aad/auth/bot/ts/sso/showUserInfo.ts +24 -0
- package/templates/plugins/resource/aad/auth/bot/ts/sso/ssoDialog.ts +182 -0
- package/templates/plugins/resource/aad/auth/bot/ts/sso/teamsSsoBot.ts +69 -0
- package/templates/plugins/resource/aad/auth/tab/README.md +15 -0
- package/templates/plugins/resource/aad/auth/tab/js/public/auth-end.html +58 -0
- package/templates/plugins/resource/aad/auth/tab/js/public/auth-start.html +57 -0
- package/templates/plugins/resource/aad/auth/tab/js/sso/GetUserProfile.jsx +34 -0
- package/templates/plugins/resource/aad/auth/tab/ts/public/auth-end.html +58 -0
- package/templates/plugins/resource/aad/auth/tab/ts/public/auth-start.html +57 -0
- package/templates/plugins/resource/aad/auth/tab/ts/sso/GetUserProfile.tsx +34 -0
- package/templates/plugins/resource/aad/manifest/aad.template.json +1 -14
- package/templates/plugins/resource/apiconnector/package.json +5 -0
- package/templates/plugins/resource/apiconnector/sample/footerComment.template +20 -0
- package/templates/plugins/resource/apiconnector/sample/headerComment.template +28 -0
- package/templates/plugins/resource/apiconnector/sample/js/aad.template +26 -0
- package/templates/plugins/resource/apiconnector/sample/js/apikey.template +19 -0
- package/templates/plugins/resource/apiconnector/sample/js/basic.template +14 -0
- package/templates/plugins/resource/apiconnector/sample/js/cert.template +15 -0
- package/templates/plugins/resource/apiconnector/sample/js/custom.template +39 -0
- package/templates/plugins/resource/apiconnector/sample/ts/aad.template +31 -0
- package/templates/plugins/resource/apiconnector/sample/ts/apikey.template +16 -0
- package/templates/plugins/resource/apiconnector/sample/ts/basic.template +14 -0
- package/templates/plugins/resource/apiconnector/sample/ts/cert.template +17 -0
- package/templates/plugins/resource/apiconnector/sample/ts/custom.template +42 -0
- package/templates/plugins/resource/bot/bicep/botProvision.template.bicep +9 -0
- package/templates/plugins/resource/bot/bicep/funcHostedBotProvision.template.bicep +2 -0
- package/templates/plugins/resource/function/bicep/functionProvision.template.bicep +2 -0
- package/templates/plugins/resource/simpleauth/bicep/simpleAuthProvision.template.bicep +4 -0
- package/templates/plugins/resource/spfx/solution/README.md +3 -3
- package/templates/plugins/resource/webapp/bicep/webappProvision.template.bicep +2 -0
- package/templates/plugins/solution/v1/README.md +1 -1
- package/templates/core/README-auto-generated.md +0 -31
- package/templates/fallback/bot-msgext.csharp.default.zip +0 -0
- package/templates/fallback/bot-msgext.js.default.zip +0 -0
- package/templates/fallback/bot-msgext.ts.default.zip +0 -0
- package/templates/fallback/msgext.js.default.zip +0 -0
- package/templates/fallback/msgext.ts.default.zip +0 -0
- package/templates/plugins/resource/apiconnector/sample/js/api-connector.template +0 -30
- package/templates/plugins/resource/apiconnector/sample/ts/api-connector.template +0 -30
- package/templates/plugins/resource/spfx/solution/_gitignore +0 -33
- package/templates/plugins/resource/spfx/solution/config/config.json +0 -19
- package/templates/plugins/resource/spfx/solution/config/copy-assets.json +0 -4
- package/templates/plugins/resource/spfx/solution/config/deploy-azure-storage.json +0 -7
- package/templates/plugins/resource/spfx/solution/config/package-solution.json +0 -21
- package/templates/plugins/resource/spfx/solution/config/serve.json +0 -10
- package/templates/plugins/resource/spfx/solution/config/write-manifests.json +0 -4
- package/templates/plugins/resource/spfx/solution/gulpfile.js +0 -16
- package/templates/plugins/resource/spfx/solution/manifest.json +0 -62
- package/templates/plugins/resource/spfx/solution/src/index.ts +0 -1
- package/templates/plugins/resource/spfx/solution/tsconfig.json +0 -35
- package/templates/plugins/resource/spfx/solution/tslint.json +0 -30
- package/templates/plugins/resource/spfx/webpart/base/images/color.png +0 -0
- package/templates/plugins/resource/spfx/webpart/base/images/outline.png +0 -0
- package/templates/plugins/resource/spfx/webpart/base/loc/en-us.js +0 -7
- package/templates/plugins/resource/spfx/webpart/base/loc/mystrings.d.ts +0 -10
- package/templates/plugins/resource/spfx/webpart/base/{componentClassName}.manifest.json +0 -27
- package/templates/plugins/resource/spfx/webpart/none/package.json +0 -28
- package/templates/plugins/resource/spfx/webpart/none/{componentClassName}.module.scss +0 -74
- package/templates/plugins/resource/spfx/webpart/none/{componentClassName}.ts +0 -61
- package/templates/plugins/resource/spfx/webpart/react/components/I{componentName}Props.ts +0 -3
- package/templates/plugins/resource/spfx/webpart/react/components/{componentName}.module.scss +0 -74
- package/templates/plugins/resource/spfx/webpart/react/components/{componentName}.tsx +0 -25
- package/templates/plugins/resource/spfx/webpart/react/package.json +0 -33
- package/templates/plugins/resource/spfx/webpart/react/{componentClassName}.ts +0 -60
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Func, FxError, Inputs, Json, Result, TokenProvider, Void, v2, ProjectSettings } from "@microsoft/teamsfx-api";
|
|
1
|
+
import { Func, FxError, Inputs, Json, Result, TokenProvider, Void, v2, ProjectSettings, QTreeNode } from "@microsoft/teamsfx-api";
|
|
2
2
|
import { EnvInfoV2, Context } from "@microsoft/teamsfx-api/build/v2";
|
|
3
3
|
import { AadAppForTeamsPlugin } from "..";
|
|
4
4
|
export declare class AadPluginV2 implements v2.ResourcePlugin {
|
|
@@ -17,5 +17,6 @@ export declare class AadPluginV2 implements v2.ResourcePlugin {
|
|
|
17
17
|
listCollaborator(ctx: v2.Context, inputs: v2.InputsWithProjectPath, envInfo: v2.DeepReadonly<v2.EnvInfoV2>, tokenProvider: TokenProvider, userInfo: Json): Promise<Result<Json, FxError>>;
|
|
18
18
|
scaffoldSourceCode(ctx: Context, inputs: Inputs): Promise<Result<Void, FxError>>;
|
|
19
19
|
deploy(ctx: v2.Context, inputs: v2.DeploymentInputs, envInfo: v2.DeepReadonly<v2.EnvInfoV2>, tokenProvider: TokenProvider): Promise<Result<Void, FxError>>;
|
|
20
|
+
getQuestions(ctx: Context, inputs: Inputs, envInfo: v2.EnvInfoV2, tokenProvider: TokenProvider): Promise<Result<QTreeNode | undefined, FxError>>;
|
|
20
21
|
}
|
|
21
22
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/resource/aad/v2/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,IAAI,EACJ,OAAO,EACP,MAAM,EACN,IAAI,EACJ,MAAM,EACN,aAAa,EACb,IAAI,EACJ,EAAE,EACF,eAAe,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/resource/aad/v2/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,IAAI,EACJ,OAAO,EACP,MAAM,EACN,IAAI,EACJ,MAAM,EACN,aAAa,EACb,IAAI,EACJ,EAAE,EACF,eAAe,EACf,SAAS,EACV,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,iCAAiC,CAAC;AAErE,OAAO,EAAE,oBAAoB,EAAE,MAAM,IAAI,CAAC;AAkB1C,qBACa,WAAY,YAAW,EAAE,CAAC,cAAc;IACnD,IAAI,SAAmC;IACvC,WAAW,SAAS;IAEpB,MAAM,EAAG,oBAAoB,CAAC;IAE9B,QAAQ,CAAC,eAAe,EAAE,eAAe,GAAG,OAAO;IAK7C,wBAAwB,CAC5B,GAAG,EAAE,EAAE,CAAC,OAAO,EACf,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;IAG1C,iBAAiB,CACrB,GAAG,EAAE,EAAE,CAAC,OAAO,EACf,MAAM,EAAE,EAAE,CAAC,eAAe,EAC1B,OAAO,EAAE,EAAE,CAAC,SAAS,EACrB,aAAa,EAAE,aAAa,GAC3B,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAI3B,iBAAiB,CACrB,GAAG,EAAE,EAAE,CAAC,OAAO,EACf,MAAM,EAAE,EAAE,CAAC,eAAe,EAC1B,OAAO,EAAE,EAAE,CAAC,SAAS,EACrB,aAAa,EAAE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AAI,EAAE,OAAO,CAAC,CAAC;IAY3B,gBAAgB,CACpB,GAAG,EAAE,EAAE,CAAC,OAAO,EACf,MAAM,EAAE,EAAE,CAAC,qBAAqB,EAChC,OAAO,EAAE,EAAE,CAAC,YAAY,CAAC,EAAE,CAAC,SAAS,CAAC,EACtC,aAAa,EAAE,aAAa,EAC5B,QAAQ,EAAE,IAAI,GACb,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAY3B,kBAAkB,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAIhF,MAAM,CACV,GAAG,EAAE,EAAE,CAAC,OAAO,EACf,MAAM,EAAE,EAAE,CAAC,gBAAgB,EAC3B,OAAO,EAAE,EAAE,CAAC,YAAY,CAAC,EAAE,CAAC,SAAS,CAAC,EACtC,aAAa,EAAE,aAAa,GAC3B,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAI3B,YAAY,CAChB,GAAG,EAAE,OAAO,EACZ,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,EAAE,CAAC,SAAS,EACrB,aAAa,EAAE,aAAa,GAC3B,OAAO,CAAC,MAAM,CAAC,SAAS,GAAG,SAAS,EAAE,OAAO,CAAC,CAAC;CAGnD"}
|
|
@@ -50,6 +50,9 @@ let AadPluginV2 = class AadPluginV2 {
|
|
|
50
50
|
async deploy(ctx, inputs, envInfo, tokenProvider) {
|
|
51
51
|
return utils4v2_1.deployAdapter(ctx, inputs, envInfo, tokenProvider, this.plugin);
|
|
52
52
|
}
|
|
53
|
+
async getQuestions(ctx, inputs, envInfo, tokenProvider) {
|
|
54
|
+
return await utils4v2_1.getQuestionsAdapter(ctx, inputs, envInfo, tokenProvider, this.plugin);
|
|
55
|
+
}
|
|
53
56
|
};
|
|
54
57
|
tslib_1.__decorate([
|
|
55
58
|
typedi_1.Inject(ResourcePluginContainer_1.ResourcePlugins.AadPlugin),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/plugins/resource/aad/v2/index.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/plugins/resource/aad/v2/index.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;;AAgBlC,mCAAyC;AACzC,0BAA0C;AAC1C,mGAG+D;AAC/D,6CAWwB;AAGxB,IAAa,WAAW,GAAxB,MAAa,WAAW;IAAxB;QACE,SAAI,GAAG,+BAA+B,CAAC;QACvC,gBAAW,GAAG,KAAK,CAAC;IAiKtB,CAAC;IA7JC,QAAQ,CAAC,eAAgC;QACvC,MAAM,gBAAgB,GAAG,eAAe,CAAC,gBAAyC,CAAC;QACnF,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC;IAChD,CAAC;IAED,KAAK,CAAC,wBAAwB,CAC5B,GAAe,EACf,MAAc;QAEd,OAAO,MAAM,0CAA+B,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IACzE,CAAC;IACD,KAAK,CAAC,iBAAiB,CACrB,GAAe,EACf,MAA0B,EAC1B,OAAqB,EACrB,aAA4B;QAE5B,OAAO,MAAM,mCAAwB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IAC1F,CAAC;IAED,KAAK,CAAC,iBAAiB,CACrB,GAAe,EACf,MAA0B,EAC1B,OAAqB,EACrB,aAA4B;QAE5B,OAAO,MAAM,mCAAwB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IAC1F,CAAC;IAED,KAAK,CAAC,sBAAsB,CAC1B,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O,EACP,aAAa,EACb,QAAQ,EACR,IAAI,CAAC,MAAM,EACX,kBAAkB,CACnB,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,kBAAkB,CAAC,GAAY,EAAE,MAAc;QACnD,OAAO,MAAM,oCAAyB,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IACnE,CAAC;IAED,KAAK,CAAC,MAAM,CACV,GAAe,EACf,MAA2B,EAC3B,OAAsC,EACtC,aAA4B;QAE5B,OAAO,wBAAa,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IACzE,CAAC;IAED,KAAK,CAAC,YAAY,CAChB,GAAY,EACZ,MAAc,EACd,OAAqB,EACrB,aAA4B;QAE5B,OAAO,MAAM,8BAAmB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IACrF,CAAC;CACF,CAAA;AA/JC;IADC,eAAM,CAAC,yCAAe,CAAC,SAAS,CAAC;sCACzB,wBAAoB;2CAAC;AAJnB,WAAW;IADvB,gBAAO,CAAC,2CAAiB,CAAC,SAAS,CAAC;GACxB,WAAW,CAmKvB;AAnKY,kCAAW"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare function checkApiNameExist(input: string, projectPath: string, components: string[], languageType: string): Promise<string | undefined>;
|
|
2
|
+
export declare function checkEmptyValue(input: string): Promise<string | undefined>;
|
|
3
|
+
export declare function checkApiNameValid(input: string): Promise<string | undefined>;
|
|
4
|
+
export declare function checkEmptySelect(input: string[]): Promise<string | undefined>;
|
|
5
|
+
export declare function checkIsGuid(input: string): Promise<string | undefined>;
|
|
6
|
+
export declare function checkHttp(input: string): Promise<string | undefined>;
|
|
7
|
+
//# sourceMappingURL=checker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checker.d.ts","sourceRoot":"","sources":["../../../../src/plugins/resource/apiconnector/checker.ts"],"names":[],"mappings":"AAUA,wBAAsB,iBAAiB,CACrC,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,MAAM,EAAE,EACpB,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAa7B;AAED,wBAAsB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAKhF;AAED,wBAAsB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAYlF;AAED,wBAAsB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAMnF;AAED,wBAAsB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAK5E;AAED,wBAAsB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAK1E"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT license.
|
|
3
|
+
"use strict";
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.checkHttp = exports.checkIsGuid = exports.checkEmptySelect = exports.checkApiNameValid = exports.checkEmptyValue = exports.checkApiNameExist = void 0;
|
|
6
|
+
const tslib_1 = require("tslib");
|
|
7
|
+
const fs = tslib_1.__importStar(require("fs-extra"));
|
|
8
|
+
const path_1 = tslib_1.__importDefault(require("path"));
|
|
9
|
+
const localizeUtils_1 = require("../../../common/localizeUtils");
|
|
10
|
+
const utils_1 = require("./utils");
|
|
11
|
+
const guidRegex = /^[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}$/;
|
|
12
|
+
async function checkApiNameExist(input, projectPath, components, languageType) {
|
|
13
|
+
const apiFileName = utils_1.getSampleFileName(input, languageType);
|
|
14
|
+
for (const component of components) {
|
|
15
|
+
const componentPath = path_1.default.join(projectPath, component);
|
|
16
|
+
// This pathExistsSync is a workaround for cli interactive command.
|
|
17
|
+
if (fs.pathExistsSync(path_1.default.join(componentPath, apiFileName))) {
|
|
18
|
+
return localizeUtils_1.getLocalizedString("plugins.apiConnector.QuestionAppName.validation.ApiNameExist", apiFileName);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return undefined;
|
|
22
|
+
}
|
|
23
|
+
exports.checkApiNameExist = checkApiNameExist;
|
|
24
|
+
async function checkEmptyValue(input) {
|
|
25
|
+
if (input) {
|
|
26
|
+
return undefined;
|
|
27
|
+
}
|
|
28
|
+
return localizeUtils_1.getLocalizedString("plugins.apiConnector.Question.validation.EmptyValue");
|
|
29
|
+
}
|
|
30
|
+
exports.checkEmptyValue = checkEmptyValue;
|
|
31
|
+
async function checkApiNameValid(input) {
|
|
32
|
+
if (input.match(/[^a-zA-Z0-9]/)) {
|
|
33
|
+
return localizeUtils_1.getLocalizedString("plugins.apiConnector.QuestionAppName.validation.ApiNameAlphanumeric");
|
|
34
|
+
}
|
|
35
|
+
if (input.match(/^[0-9]/)) {
|
|
36
|
+
return localizeUtils_1.getLocalizedString("plugins.apiConnector.QuestionAppName.validation.ApiNameNumberPrefix");
|
|
37
|
+
}
|
|
38
|
+
return undefined;
|
|
39
|
+
}
|
|
40
|
+
exports.checkApiNameValid = checkApiNameValid;
|
|
41
|
+
async function checkEmptySelect(input) {
|
|
42
|
+
const name = input;
|
|
43
|
+
if (name.length === 0) {
|
|
44
|
+
return localizeUtils_1.getLocalizedString("plugins.apiConnector.questionComponentSelect.emptySelection");
|
|
45
|
+
}
|
|
46
|
+
return undefined;
|
|
47
|
+
}
|
|
48
|
+
exports.checkEmptySelect = checkEmptySelect;
|
|
49
|
+
async function checkIsGuid(input) {
|
|
50
|
+
if (guidRegex.exec(input)) {
|
|
51
|
+
return undefined;
|
|
52
|
+
}
|
|
53
|
+
return localizeUtils_1.getLocalizedString("plugins.apiConnector.Question.validation.NotGuid");
|
|
54
|
+
}
|
|
55
|
+
exports.checkIsGuid = checkIsGuid;
|
|
56
|
+
async function checkHttp(input) {
|
|
57
|
+
if (isValidHttpUrl(input)) {
|
|
58
|
+
return undefined;
|
|
59
|
+
}
|
|
60
|
+
return localizeUtils_1.getLocalizedString("plugins.apiConnector.QuestionApiEndpoint.validation.NotHttp");
|
|
61
|
+
}
|
|
62
|
+
exports.checkHttp = checkHttp;
|
|
63
|
+
function isValidHttpUrl(str) {
|
|
64
|
+
let url;
|
|
65
|
+
try {
|
|
66
|
+
url = new URL(str);
|
|
67
|
+
}
|
|
68
|
+
catch (_) {
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
return url.protocol === "http:" || url.protocol === "https:";
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=checker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checker.js","sourceRoot":"","sources":["../../../../src/plugins/resource/apiconnector/checker.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,YAAY,CAAC;;;;AACb,qDAA+B;AAC/B,wDAAwB;AACxB,iEAAmE;AACnE,mCAA4C;AAE5C,MAAM,SAAS,GAAG,sDAAsD,CAAC;AAElE,KAAK,UAAU,iBAAiB,CACrC,KAAa,EACb,WAAmB,EACnB,UAAoB,EACpB,YAAoB;IAEpB,MAAM,WAAW,GAAW,yBAAiB,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;IACnE,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE;QAClC,MAAM,aAAa,GAAG,cAAI,CAAC,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;QACxD,mEAAmE;QACnE,IAAI,EAAE,CAAC,cAAc,CAAC,cAAI,CAAC,IAAI,CAAC,aAAa,EAAE,WA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C,IAAI,GAAG,CAAC;IAER,IAAI;QACF,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;KACpB;IAAC,OAAO,CAAC,EAAE;QACV,OAAO,KAAK,CAAC;KACd;IAED,OAAO,GAAG,CAAC,QAAQ,KAAK,OAAO,IAAI,GAAG,CAAC,QAAQ,KAAK,QAAQ,CAAC;AAC/D,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { AuthType, KeyLocation } from "./constants";
|
|
2
|
+
export interface ApiConnectorConfiguration extends Record<any, any> {
|
|
3
|
+
ComponentType: string[];
|
|
4
|
+
APIName: string;
|
|
5
|
+
EndPoint: string;
|
|
6
|
+
AuthConfig: AuthConfig;
|
|
7
|
+
}
|
|
8
|
+
export interface AuthConfig {
|
|
9
|
+
AuthType: AuthType;
|
|
10
|
+
}
|
|
11
|
+
export interface BasicAuthConfig extends AuthConfig {
|
|
12
|
+
UserName: string;
|
|
13
|
+
}
|
|
14
|
+
export interface AADAuthConfig extends AuthConfig {
|
|
15
|
+
ReuseTeamsApp: boolean;
|
|
16
|
+
TenantId?: string;
|
|
17
|
+
ClientId?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface APIKeyAuthConfig extends AuthConfig {
|
|
20
|
+
Name: string;
|
|
21
|
+
Location: KeyLocation;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../src/plugins/resource/apiconnector/config.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAEpD,MAAM,WAAW,yBAA0B,SAAQ,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC;IACjE,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,UAAU,CAAC;CACxB;AAED,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,QAAQ,CAAC;CACpB;AAED,MAAM,WAAW,eAAgB,SAAQ,UAAU;IACjD,QAAQ,EAAE,MAAM,CAAC;CAClB;AACD,MAAM,WAAW,aAAc,SAAQ,UAAU;IAC/C,aAAa,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AACD,MAAM,WAAW,gBAAiB,SAAQ,UAAU;IAClD,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,WAAW,CAAC;CACvB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../../src/plugins/resource/apiconnector/config.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,YAAY,CAAC"}
|
|
@@ -2,6 +2,17 @@ export declare enum ComponentType {
|
|
|
2
2
|
API = "api",
|
|
3
3
|
BOT = "bot"
|
|
4
4
|
}
|
|
5
|
+
export declare enum AuthType {
|
|
6
|
+
BASIC = "basic",
|
|
7
|
+
APIKEY = "apikey",
|
|
8
|
+
AAD = "aad",
|
|
9
|
+
CERT = "cert",
|
|
10
|
+
CUSTOM = "custom"
|
|
11
|
+
}
|
|
12
|
+
export declare enum KeyLocation {
|
|
13
|
+
Header = "request header",
|
|
14
|
+
QueryParams = "query parameter"
|
|
15
|
+
}
|
|
5
16
|
export declare enum LanguageType {
|
|
6
17
|
JS = "javascript",
|
|
7
18
|
TS = "typescript"
|
|
@@ -13,13 +24,26 @@ export declare enum FileType {
|
|
|
13
24
|
export declare class Constants {
|
|
14
25
|
static readonly PLUGIN_NAME = "APIConnector";
|
|
15
26
|
static readonly pluginNameShort = "api-connector";
|
|
27
|
+
static readonly headerCommentTemplate = "headerComment.template";
|
|
28
|
+
static readonly footerCommentTemplate = "footerComment.template";
|
|
29
|
+
static readonly templateEx = ".template";
|
|
30
|
+
static readonly envPrefix = "TEAMSFX_API_";
|
|
31
|
+
static readonly envFileName = ".env.teamsfx.local";
|
|
32
|
+
static readonly pkgJsonFile = "package.json";
|
|
33
|
+
static readonly pkgLockFile = "package-lock.json";
|
|
34
|
+
static readonly sdkName = "@microsoft/teamsfx";
|
|
35
|
+
static readonly sdkJsName = "@microsft/teams-js";
|
|
16
36
|
static readonly questionKey: {
|
|
17
37
|
componentsSelect: string;
|
|
18
38
|
endpoint: string;
|
|
19
39
|
apiName: string;
|
|
20
40
|
apiType: string;
|
|
21
41
|
apiUserName: string;
|
|
22
|
-
|
|
42
|
+
apiAppType: string;
|
|
43
|
+
apiAppTenentId: string;
|
|
44
|
+
apiAppId: string;
|
|
45
|
+
apiAPIKeyLocation: string;
|
|
46
|
+
apiAPIKeyName: string;
|
|
23
47
|
};
|
|
24
48
|
}
|
|
25
49
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/plugins/resource/apiconnector/constants.ts"],"names":[],"mappings":"AAIA,oBAAY,aAAa;IACvB,GAAG,QAAQ;IACX,GAAG,QAAQ;CACZ;AAED,oBAAY,YAAY;IACtB,EAAE,eAAe;IACjB,EAAE,eAAe;CAClB;AAED,oBAAY,QAAQ;IAClB,EAAE,OAAO;IACT,EAAE,OAAO;CACV;AACD,qBAAa,SAAS;IACpB,gBAAuB,WAAW,kBAAkB;IACpD,gBAAuB,eAAe,mBAAmB;
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/plugins/resource/apiconnector/constants.ts"],"names":[],"mappings":"AAIA,oBAAY,aAAa;IACvB,GAAG,QAAQ;IACX,GAAG,QAAQ;CACZ;AAED,oBAAY,QAAQ;IAClB,KAAK,UAAU;IACf,MAAM,WAAW;IACjB,GAAG,QAAQ;IACX,IAAI,SAAS;IACb,MAAM,WAAW;CAClB;AAED,oBAAY,WAAW;IACrB,MAAM,mBAAmB;IACzB,WAAW,oBAAoB;CAChC;AAED,oBAAY,YAAY;IACtB,EAAE,eAAe;IACjB,EAAE,eAAe;CAClB;AAED,oBAAY,QAAQ;IAClB,EAAE,OAAO;IACT,EAAE,OAAO;CACV;AACD,qBAAa,SAAS;IACpB,gBAAuB,WAAW,kBAAkB;IACpD,gBAAuB,eAAe,mBAAmB;IACzD,gBAAuB,qBAAqB,4BAA4B;IACxE,gBAAuB,qBAAqB,4BAA4B;IACxE,gBAAuB,UAAU,eAAe;IAChD,gBAAuB,SAAS,kBAAkB;IAElD,gBAAuB,WAAW,wBAAwB;IAC1D,gBAAuB,WAAW,kBAAkB;IACpD,gBAAuB,WAAW,uBAAuB;IACzD,gBAAuB,OAAO,wBAAwB;IACtD,gBAAuB,SAAS,wBAAwB;IAExD,gBAAuB,WAAW;;;;;;;;;;;MAWhC;CACH"}
|
|
@@ -2,12 +2,25 @@
|
|
|
2
2
|
// Licensed under the MIT license.
|
|
3
3
|
"use strict";
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.Constants = exports.FileType = exports.LanguageType = exports.ComponentType = void 0;
|
|
5
|
+
exports.Constants = exports.FileType = exports.LanguageType = exports.KeyLocation = exports.AuthType = exports.ComponentType = void 0;
|
|
6
6
|
var ComponentType;
|
|
7
7
|
(function (ComponentType) {
|
|
8
8
|
ComponentType["API"] = "api";
|
|
9
9
|
ComponentType["BOT"] = "bot";
|
|
10
10
|
})(ComponentType = exports.ComponentType || (exports.ComponentType = {}));
|
|
11
|
+
var AuthType;
|
|
12
|
+
(function (AuthType) {
|
|
13
|
+
AuthType["BASIC"] = "basic";
|
|
14
|
+
AuthType["APIKEY"] = "apikey";
|
|
15
|
+
AuthType["AAD"] = "aad";
|
|
16
|
+
AuthType["CERT"] = "cert";
|
|
17
|
+
AuthType["CUSTOM"] = "custom";
|
|
18
|
+
})(AuthType = exports.AuthType || (exports.AuthType = {}));
|
|
19
|
+
var KeyLocation;
|
|
20
|
+
(function (KeyLocation) {
|
|
21
|
+
KeyLocation["Header"] = "request header";
|
|
22
|
+
KeyLocation["QueryParams"] = "query parameter";
|
|
23
|
+
})(KeyLocation = exports.KeyLocation || (exports.KeyLocation = {}));
|
|
11
24
|
var LanguageType;
|
|
12
25
|
(function (LanguageType) {
|
|
13
26
|
LanguageType["JS"] = "javascript";
|
|
@@ -23,12 +36,25 @@ class Constants {
|
|
|
23
36
|
exports.Constants = Constants;
|
|
24
37
|
Constants.PLUGIN_NAME = "APIConnector";
|
|
25
38
|
Constants.pluginNameShort = "api-connector";
|
|
39
|
+
Constants.headerCommentTemplate = "headerComment.template";
|
|
40
|
+
Constants.footerCommentTemplate = "footerComment.template";
|
|
41
|
+
Constants.templateEx = ".template";
|
|
42
|
+
Constants.envPrefix = "TEAMSFX_API_";
|
|
43
|
+
Constants.envFileName = ".env.teamsfx.local";
|
|
44
|
+
Constants.pkgJsonFile = "package.json";
|
|
45
|
+
Constants.pkgLockFile = "package-lock.json";
|
|
46
|
+
Constants.sdkName = "@microsoft/teamsfx";
|
|
47
|
+
Constants.sdkJsName = "@microsft/teams-js";
|
|
26
48
|
Constants.questionKey = {
|
|
27
|
-
componentsSelect: "
|
|
28
|
-
endpoint: "
|
|
29
|
-
apiName: "
|
|
30
|
-
apiType: "
|
|
31
|
-
apiUserName: "
|
|
32
|
-
|
|
49
|
+
componentsSelect: "component",
|
|
50
|
+
endpoint: "endpoint",
|
|
51
|
+
apiName: "alias",
|
|
52
|
+
apiType: "auth-type",
|
|
53
|
+
apiUserName: "user-name",
|
|
54
|
+
apiAppType: "app-type",
|
|
55
|
+
apiAppTenentId: "tenant-id",
|
|
56
|
+
apiAppId: "app-id",
|
|
57
|
+
apiAPIKeyLocation: "key-location",
|
|
58
|
+
apiAPIKeyName: "key-name", // for aad auth
|
|
33
59
|
};
|
|
34
60
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../src/plugins/resource/apiconnector/constants.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,YAAY,CAAC;;;AAEb,IAAY,aAGX;AAHD,WAAY,aAAa;IACvB,4BAAW,CAAA;IACX,4BAAW,CAAA;AACb,CAAC,EAHW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAGxB;AAED,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,iCAAiB,CAAA;IACjB,iCAAiB,CAAA;AACnB,CAAC,EAHW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAGvB;AAED,IAAY,QAGX;AAHD,WAAY,QAAQ;IAClB,qBAAS,CAAA;IACT,qBAAS,CAAA;AACX,CAAC,EAHW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAGnB;AACD,MAAa,SAAS;;AAAtB,
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../src/plugins/resource/apiconnector/constants.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,YAAY,CAAC;;;AAEb,IAAY,aAGX;AAHD,WAAY,aAAa;IACvB,4BAAW,CAAA;IACX,4BAAW,CAAA;AACb,CAAC,EAHW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAGxB;AAED,IAAY,QAMX;AAND,WAAY,QAAQ;IAClB,2BAAe,CAAA;IACf,6BAAiB,CAAA;IACjB,uBAAW,CAAA;IACX,yBAAa,CAAA;IACb,6BAAiB,CAAA;AACnB,CAAC,EANW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAMnB;AAED,IAAY,WAGX;AAHD,WAAY,WAAW;IACrB,wCAAyB,CAAA;IACzB,8CAA+B,CAAA;AACjC,CAAC,EAHW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAGtB;AAED,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,iCAAiB,CAAA;IACjB,iCAAiB,CAAA;AACnB,CAAC,EAHW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAGvB;AAED,IAAY,QAGX;AAHD,WAAY,QAAQ;IAClB,qBAAS,CAAA;IACT,qBAAS,CAAA;AACX,CAAC,EAHW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAGnB;AACD,MAAa,SAAS;;AAAtB,8BA0BC;AAzBwB,qBAAW,GAAG,cAAc,CAAC;AAC7B,yBAAe,GAAG,eAAe,CAAC;AAClC,+BAAqB,GAAG,wBAAwB,CAAC;AACjD,+BAAqB,GAAG,wBAAwB,CAAC;AACjD,oBAAU,GAAG,WAAW,CAAC;AACzB,mBAAS,GAAG,cAAc,CAAC;AAE3B,qBAAW,GAAG,oBAAoB,CAAC;AACnC,qBAAW,GAAG,cAAc,CAAC;AAC7B,qBAAW,GAAG,mBAAmB,CAAC;AAClC,iBAAO,GAAG,oBAAoB,CAAC;AAC/B,mBAAS,GAAG,oBAAoB,CAAC;AAEjC,qBAAW,GAAG;IACnC,gBAAgB,EAAE,WAAW;IAC7B,QAAQ,EAAE,UAAU;IACpB,OAAO,EAAE,OAAO;IAChB,OAAO,EAAE,WAAW;IACpB,WAAW,EAAE,WAAW;IACxB,UAAU,EAAE,UAAU;IACtB,cAAc,EAAE,WAAW;IAC3B,QAAQ,EAAE,QAAQ;IAClB,iBAAiB,EAAE,cAAc;IACjC,aAAa,EAAE,UAAU,EAAE,eAAe;CAC3C,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Json } from "@microsoft/teamsfx-api";
|
|
2
|
+
import { FileChange } from "./result";
|
|
3
|
+
export declare class DepsHandler {
|
|
4
|
+
private readonly projectRoot;
|
|
5
|
+
private readonly componentType;
|
|
6
|
+
constructor(workspaceFolder: string, componentType: string);
|
|
7
|
+
addPkgDeps(): Promise<FileChange | undefined>;
|
|
8
|
+
getDepsConfig(): Promise<Json>;
|
|
9
|
+
updateLocalPkgDepsVersion(pkgConfig: Json): Promise<FileChange | undefined>;
|
|
10
|
+
private sdkVersionCheck;
|
|
11
|
+
private caretPrereleases;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=depsHandler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"depsHandler.d.ts","sourceRoot":"","sources":["../../../../src/plugins/resource/apiconnector/depsHandler.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAK9C,OAAO,EAAiB,UAAU,EAAkB,MAAM,UAAU,CAAC;AAIrE,qBAAa,WAAW;IACtB,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;IACrC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAS;gBAC3B,eAAe,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM;IAK7C,UAAU,IAAI,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC;IAK7C,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAO9B,yBAAyB,CAAC,SAAS,EAAE,IAAI,GAAG,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC;IA+BxF,OAAO,CAAC,eAAe;IA4BvB,OAAO,CAAC,gBAAgB;CAczB"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT license.
|
|
3
|
+
"use strict";
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.DepsHandler = void 0;
|
|
6
|
+
const tslib_1 = require("tslib");
|
|
7
|
+
const fs = tslib_1.__importStar(require("fs-extra"));
|
|
8
|
+
const path = tslib_1.__importStar(require("path"));
|
|
9
|
+
const semver_1 = tslib_1.__importDefault(require("semver"));
|
|
10
|
+
const constants_1 = require("./constants");
|
|
11
|
+
const result_1 = require("./result");
|
|
12
|
+
const errors_1 = require("./errors");
|
|
13
|
+
const telemetry_1 = require("./telemetry");
|
|
14
|
+
const folder_1 = require("../../../folder");
|
|
15
|
+
class DepsHandler {
|
|
16
|
+
constructor(workspaceFolder, componentType) {
|
|
17
|
+
this.projectRoot = workspaceFolder;
|
|
18
|
+
this.componentType = componentType;
|
|
19
|
+
}
|
|
20
|
+
async addPkgDeps() {
|
|
21
|
+
const depsConfig = await this.getDepsConfig();
|
|
22
|
+
return await this.updateLocalPkgDepsVersion(depsConfig);
|
|
23
|
+
}
|
|
24
|
+
async getDepsConfig() {
|
|
25
|
+
const configPath = path.join(folder_1.getTemplatesFolder(), "plugins", "resource", "apiconnector");
|
|
26
|
+
const sdkConfigPath = path.join(configPath, constants_1.Constants.pkgJsonFile);
|
|
27
|
+
const sdkContent = await fs.readJson(sdkConfigPath);
|
|
28
|
+
return sdkContent.dependencies;
|
|
29
|
+
}
|
|
30
|
+
async updateLocalPkgDepsVersion(pkgConfig) {
|
|
31
|
+
const localPkgPath = path.join(this.projectRoot, this.componentType, constants_1.Constants.pkgJsonFile);
|
|
32
|
+
if (!(await fs.pathExists(localPkgPath))) {
|
|
33
|
+
throw result_1.ResultFactory.UserError(errors_1.ErrorMessage.localPkgFileNotExistError.name, errors_1.ErrorMessage.localPkgFileNotExistError.message(this.componentType));
|
|
34
|
+
}
|
|
35
|
+
const pkgContent = await fs.readJson(localPkgPath);
|
|
36
|
+
let needUpdate = false;
|
|
37
|
+
for (const pkgItem in pkgConfig) {
|
|
38
|
+
if (this.sdkVersionCheck(pkgContent.dependencies, pkgItem, pkgConfig[pkgItem])) {
|
|
39
|
+
pkgContent.dependencies[pkgItem] = pkgConfig[pkgItem];
|
|
40
|
+
needUpdate = true;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
if (needUpdate) {
|
|
44
|
+
await fs.writeFile(localPkgPath, JSON.stringify(pkgContent, null, 4));
|
|
45
|
+
const telemetryProperties = {
|
|
46
|
+
[telemetry_1.Telemetry.properties.componentType]: this.componentType,
|
|
47
|
+
};
|
|
48
|
+
telemetry_1.TelemetryUtils.sendEvent(telemetry_1.Telemetry.stage.updatePkg, undefined, telemetryProperties);
|
|
49
|
+
return {
|
|
50
|
+
changeType: result_1.FileChangeType.Update,
|
|
51
|
+
filePath: localPkgPath,
|
|
52
|
+
}; // return modified files
|
|
53
|
+
}
|
|
54
|
+
return undefined;
|
|
55
|
+
}
|
|
56
|
+
sdkVersionCheck(deps, sdkName, sdkVersion) {
|
|
57
|
+
// sdk alpha version
|
|
58
|
+
if (this.caretPrereleases(deps[sdkName], sdkVersion)) {
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
// sdk not in dependencies.
|
|
62
|
+
else if (!deps[sdkName]) {
|
|
63
|
+
return true;
|
|
64
|
+
}
|
|
65
|
+
// local sdk version intersect with sdk version in config.
|
|
66
|
+
else if (semver_1.default.intersects(deps[sdkName], sdkVersion)) {
|
|
67
|
+
return false;
|
|
68
|
+
}
|
|
69
|
+
// local sdk version lager than sdk version in config.
|
|
70
|
+
else if (semver_1.default.gt(semver_1.default.minVersion(deps[sdkName]), semver_1.default.minVersion(sdkVersion))) {
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
throw result_1.ResultFactory.UserError(errors_1.ErrorMessage.sdkVersionImcompatibleError.name, errors_1.ErrorMessage.sdkVersionImcompatibleError.message(this.componentType, deps[sdkName], sdkVersion));
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
caretPrereleases(ver1, ver2) {
|
|
78
|
+
if (!semver_1.default.prerelease(ver1) || !semver_1.default.prerelease(ver2)) {
|
|
79
|
+
return false;
|
|
80
|
+
}
|
|
81
|
+
// semver.prerelease an prerelease version return alpha, beta or rc.
|
|
82
|
+
// example: semver.prerelease(0.6.0-alpha.12345.0) return ["alpha", "12345", "0"]
|
|
83
|
+
if (semver_1.default.prerelease(ver1)[0] != semver_1.default.prerelease(ver2)[0]) {
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
86
|
+
if (semver_1.default.satisfies(semver_1.default.coerce(ver1).version, `^${semver_1.default.coerce(ver2).version}`)) {
|
|
87
|
+
return true;
|
|
88
|
+
}
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
exports.DepsHandler = DepsHandler;
|
|
93
|
+
//# sourceMappingURL=depsHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"depsHandler.js","sourceRoot":"","sources":["../../../../src/plugins/resource/apiconnector/depsHandler.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,YAAY,CAAC;;;;AAGb,qDAA+B;AAC/B,mDAA6B;AAC7B,4DAA4B;AAC5B,2CAAwC;AACxC,qCAAqE;AACrE,qCAAwC;AACxC,2CAAwD;AACxD,4CAAqD;AACrD,MAAa,WAAW;IAGtB,YAAY,eAAuB,EAAE,aAAqB;QACxD,IAAI,CAAC,WAAW,GAAG,eAAe,CAAC;QACnC,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;IACrC,CAAC;IAEM,KAAK,CAAC,UAAU;QACrB,MAAM,UAAU,GAAS,MAAM,IAAI,CAAC,aAAa,EAAE,CAAC;QACpD,OAAO,MAAM,IAAI,CAAC,yBAAyB,CAAC,UAAU,CAAC,CAAC;IAC1D,CAAC;IAEM,KAAK,CAAC,aAAa;QACxB,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,2BAAkB,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE,cAAc,CAAC,CAAC;QAC1F,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,qBAAS,CAAC,WAAW,CAAC,CAAC;QACnE,MAAM,UAAU,GAAS,MAAM,EAAE,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;QAC1D,OAAO,UAAU,CAAC,YAAY,CAAC;IACjC,CAAC;IAEM,KAAK,CAAC,yBAAyB,CAAC,SAAe;QACpD,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,aAAa,EAAE,qBAAS,CAAC,WAAW,CA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,EAAE;YACtF,OAAO,IAAI,CAAC;SACb;QACD,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AA7FD,kCA6FC"}
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
import { LocalEnvs } from "../../../common/local/localEnvProvider";
|
|
2
|
-
import { ApiConnectorConfiguration } from "./
|
|
3
|
-
import {
|
|
2
|
+
import { ApiConnectorConfiguration } from "./config";
|
|
3
|
+
import { FileChange } from "./result";
|
|
4
4
|
export declare class ApiDataManager {
|
|
5
5
|
private apiConnector;
|
|
6
6
|
updateLocalApiEnvs(localEnvs: LocalEnvs): LocalEnvs;
|
|
7
7
|
addApiEnvs(config: ApiConnectorConfiguration): void;
|
|
8
|
+
addBasicEnvs(config: ApiConnectorConfiguration): void;
|
|
9
|
+
addAADEnvs(config: ApiConnectorConfiguration): void;
|
|
10
|
+
addAPIKeyEnvs(config: ApiConnectorConfiguration): void;
|
|
8
11
|
}
|
|
9
12
|
export declare class EnvHandler {
|
|
10
|
-
static readonly LocalEnvFileName: string;
|
|
11
13
|
private readonly projectRoot;
|
|
12
14
|
private readonly componentType;
|
|
13
15
|
private apiDataManager;
|
|
14
16
|
constructor(workspaceFolder: string, componentType: string);
|
|
15
17
|
updateEnvs(config: ApiConnectorConfiguration): void;
|
|
16
|
-
saveLocalEnvFile(): Promise<
|
|
18
|
+
saveLocalEnvFile(): Promise<FileChange>;
|
|
17
19
|
private updateLocalApiEnvs;
|
|
18
20
|
}
|
|
19
21
|
//# sourceMappingURL=envHandler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"envHandler.d.ts","sourceRoot":"","sources":["../../../../src/plugins/resource/apiconnector/envHandler.ts"],"names":[],"mappings":"AAMA,OAAO,EAAoB,SAAS,EAAE,MAAM,wCAAwC,CAAC;AACrF,OAAO,
|
|
1
|
+
{"version":3,"file":"envHandler.d.ts","sourceRoot":"","sources":["../../../../src/plugins/resource/apiconnector/envHandler.ts"],"names":[],"mappings":"AAMA,OAAO,EAAoB,SAAS,EAAE,MAAM,wCAAwC,CAAC;AACrF,OAAO,EAAiB,yBAAyB,EAAmB,MAAM,UAAU,CAAC;AACrF,OAAO,EAAE,UAAU,EAAiC,MAAM,UAAU,CAAC;AAMrE,qBAAa,cAAc;IACzB,OAAO,CAAC,YAAY,CAAqB;IAClC,kBAAkB,CAAC,SAAS,EAAE,SAAS,GAAG,SAAS;IAmBnD,UAAU,CAAC,MAAM,EAAE,yBAAyB;IAgB5C,YAAY,CAAC,MAAM,EAAE,yBAAyB;IAU9C,UAAU,CAAC,MAAM,EAAE,yBAAyB;IAc5C,aAAa,CAAC,MAAM,EAAE,yBAAyB;CAMvD;AACD,qBAAa,UAAU;IACrB,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;IACrC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAS;IACvC,OAAO,CAAC,cAAc,CAAiB;gBAE3B,eAAe,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM;IAMnD,UAAU,CAAC,MAAM,EAAE,yBAAyB;IAItC,gBAAgB,IAAI,OAAO,CAAC,UAAU,CAAC;IAkCpD,OAAO,CAAC,kBAAkB;CAI3B"}
|
|
@@ -10,15 +10,23 @@ const localEnvProvider_1 = require("../../../common/local/localEnvProvider");
|
|
|
10
10
|
const result_1 = require("./result");
|
|
11
11
|
const constants_1 = require("./constants");
|
|
12
12
|
const errors_1 = require("./errors");
|
|
13
|
+
const teamsfx_api_1 = require("@microsoft/teamsfx-api");
|
|
13
14
|
class ApiDataManager {
|
|
14
15
|
constructor() {
|
|
15
16
|
this.apiConnector = {};
|
|
16
17
|
}
|
|
17
18
|
updateLocalApiEnvs(localEnvs) {
|
|
18
|
-
|
|
19
|
+
const customEnvs = localEnvs.customizedLocalEnvs;
|
|
19
20
|
for (const item in this.apiConnector) {
|
|
20
21
|
const apis = this.apiConnector[item];
|
|
21
|
-
|
|
22
|
+
for (const [key, value] of Array.from(apis)) {
|
|
23
|
+
if (customEnvs[key]) {
|
|
24
|
+
throw result_1.ResultFactory.UserError(errors_1.ErrorMessage.envVarExistError.name, errors_1.ErrorMessage.envVarExistError.message(key));
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
customEnvs[key] = value;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
22
30
|
}
|
|
23
31
|
localEnvs.customizedLocalEnvs = customEnvs;
|
|
24
32
|
return localEnvs;
|
|
@@ -26,22 +34,47 @@ class ApiDataManager {
|
|
|
26
34
|
addApiEnvs(config) {
|
|
27
35
|
const apiName = config.APIName.toUpperCase();
|
|
28
36
|
if (!this.apiConnector[apiName]) {
|
|
29
|
-
this.apiConnector[apiName] =
|
|
37
|
+
this.apiConnector[apiName] = new Map();
|
|
38
|
+
}
|
|
39
|
+
const endPoint = constants_1.Constants.envPrefix + apiName + "_ENDPOINT";
|
|
40
|
+
this.apiConnector[apiName].set(endPoint, config.EndPoint);
|
|
41
|
+
if (config.AuthConfig.AuthType === constants_1.AuthType.BASIC) {
|
|
42
|
+
this.addBasicEnvs(config);
|
|
30
43
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
const userName = "API_" + apiName + "_USERNAME";
|
|
34
|
-
const passWd = "API_" + apiName + "_PASSWORD";
|
|
35
|
-
if (config.ApiUserName) {
|
|
36
|
-
this.apiConnector[apiName][userName] = config.ApiUserName;
|
|
44
|
+
else if (config.AuthConfig.AuthType === constants_1.AuthType.AAD) {
|
|
45
|
+
this.addAADEnvs(config);
|
|
37
46
|
}
|
|
38
|
-
if (config.
|
|
39
|
-
this.
|
|
47
|
+
else if (config.AuthConfig.AuthType === constants_1.AuthType.APIKEY) {
|
|
48
|
+
this.addAPIKeyEnvs(config);
|
|
40
49
|
}
|
|
41
|
-
|
|
42
|
-
|
|
50
|
+
}
|
|
51
|
+
addBasicEnvs(config) {
|
|
52
|
+
const apiName = config.APIName.toUpperCase();
|
|
53
|
+
const apiConfig = this.apiConnector[apiName];
|
|
54
|
+
const userName = constants_1.Constants.envPrefix + apiName + "_USERNAME";
|
|
55
|
+
const passWd = constants_1.Constants.envPrefix + apiName + "_PASSWORD";
|
|
56
|
+
const authConfig = config.AuthConfig;
|
|
57
|
+
apiConfig.set(userName, authConfig.UserName);
|
|
58
|
+
apiConfig.set(passWd, "");
|
|
59
|
+
}
|
|
60
|
+
addAADEnvs(config) {
|
|
61
|
+
const apiName = config.APIName.toUpperCase();
|
|
62
|
+
const apiConfig = this.apiConnector[apiName];
|
|
63
|
+
const authConfig = config.AuthConfig;
|
|
64
|
+
if (!authConfig.ReuseTeamsApp) {
|
|
65
|
+
const tenantId = constants_1.Constants.envPrefix + apiName + "_TENANT_ID";
|
|
66
|
+
const clientId = constants_1.Constants.envPrefix + apiName + "_CLIENT_ID";
|
|
67
|
+
const clientSecret = constants_1.Constants.envPrefix + apiName + "_CLIENT_SECRET";
|
|
68
|
+
apiConfig.set(tenantId, authConfig.TenantId);
|
|
69
|
+
apiConfig.set(clientId, authConfig.ClientId);
|
|
70
|
+
apiConfig.set(clientSecret, "");
|
|
43
71
|
}
|
|
44
|
-
|
|
72
|
+
}
|
|
73
|
+
addAPIKeyEnvs(config) {
|
|
74
|
+
const apiName = config.APIName.toUpperCase();
|
|
75
|
+
const apiConfig = this.apiConnector[apiName];
|
|
76
|
+
const apiKey = constants_1.Constants.envPrefix + apiName + "_API_KEY";
|
|
77
|
+
apiConfig.set(apiKey, "");
|
|
45
78
|
}
|
|
46
79
|
}
|
|
47
80
|
exports.ApiDataManager = ApiDataManager;
|
|
@@ -55,15 +88,12 @@ class EnvHandler {
|
|
|
55
88
|
this.apiDataManager.addApiEnvs(config);
|
|
56
89
|
}
|
|
57
90
|
async saveLocalEnvFile() {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
const backupFileName = EnvHandler.LocalEnvFileName + "." + timestamp;
|
|
61
|
-
const srcFile = path.join(this.projectRoot, this.componentType, EnvHandler.LocalEnvFileName);
|
|
62
|
-
const tmpFile = path.join(this.projectRoot, this.componentType, backupFileName);
|
|
91
|
+
const srcFile = path.join(this.projectRoot, this.componentType, constants_1.Constants.envFileName);
|
|
92
|
+
let fileChangeType = result_1.FileChangeType.Update;
|
|
63
93
|
if (!(await fs.pathExists(srcFile))) {
|
|
64
94
|
await fs.createFile(srcFile);
|
|
95
|
+
fileChangeType = result_1.FileChangeType.Create;
|
|
65
96
|
}
|
|
66
|
-
await fs.move(srcFile, tmpFile);
|
|
67
97
|
// update localEnvs
|
|
68
98
|
try {
|
|
69
99
|
const provider = new localEnvProvider_1.LocalEnvProvider(this.projectRoot);
|
|
@@ -79,13 +109,15 @@ class EnvHandler {
|
|
|
79
109
|
}
|
|
80
110
|
}
|
|
81
111
|
catch (err) {
|
|
82
|
-
|
|
112
|
+
if (err instanceof teamsfx_api_1.UserError) {
|
|
113
|
+
throw err;
|
|
114
|
+
}
|
|
83
115
|
throw result_1.ResultFactory.SystemError(errors_1.ErrorMessage.ApiConnectorFileCreateFailError.name, errors_1.ErrorMessage.ApiConnectorFileCreateFailError.message(srcFile));
|
|
84
116
|
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
return
|
|
117
|
+
return {
|
|
118
|
+
changeType: fileChangeType,
|
|
119
|
+
filePath: srcFile,
|
|
120
|
+
}; // return modified env file
|
|
89
121
|
}
|
|
90
122
|
updateLocalApiEnvs(localEnvs) {
|
|
91
123
|
const res = this.apiDataManager.updateLocalApiEnvs(localEnvs);
|
|
@@ -93,5 +125,4 @@ class EnvHandler {
|
|
|
93
125
|
}
|
|
94
126
|
}
|
|
95
127
|
exports.EnvHandler = EnvHandler;
|
|
96
|
-
EnvHandler.LocalEnvFileName = ".env.teamsfx.local";
|
|
97
128
|
//# sourceMappingURL=envHandler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"envHandler.js","sourceRoot":"","sources":["../../../../src/plugins/resource/apiconnector/envHandler.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,YAAY,CAAC;;;;A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