@microsoft/teamsfx-core 2.0.2-alpha.8828ab140.0 → 2.0.2-alpha.a32ea10b4.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 -14
- package/build/common/constants.d.ts.map +1 -1
- package/build/common/constants.js +2 -17
- package/build/common/constants.js.map +1 -1
- package/build/common/featureFlags.d.ts +0 -4
- package/build/common/featureFlags.d.ts.map +1 -1
- package/build/common/featureFlags.js +6 -25
- package/build/common/featureFlags.js.map +1 -1
- package/build/common/jsonUtils.d.ts +1 -0
- package/build/common/jsonUtils.d.ts.map +1 -1
- package/build/common/jsonUtils.js +17 -0
- package/build/common/jsonUtils.js.map +1 -1
- package/build/common/local/localEnvManager.js +1 -1
- package/build/common/local/localEnvManager.js.map +1 -1
- package/build/common/local/localTelemetryReporter.d.ts.map +1 -1
- package/build/common/local/localTelemetryReporter.js +2 -1
- package/build/common/local/localTelemetryReporter.js.map +1 -1
- package/build/common/m365/launchHelper.d.ts.map +1 -1
- package/build/common/m365/launchHelper.js +3 -5
- package/build/common/m365/launchHelper.js.map +1 -1
- package/build/common/m365/packageService.d.ts.map +1 -1
- package/build/common/m365/packageService.js +9 -5
- package/build/common/m365/packageService.js.map +1 -1
- package/build/common/projectSettingsHelper.d.ts.map +1 -1
- package/build/common/projectSettingsHelper.js +0 -12
- package/build/common/projectSettingsHelper.js.map +1 -1
- package/build/common/samples-config-v3.json +0 -15
- package/build/common/telemetry.d.ts +2 -1
- package/build/common/telemetry.d.ts.map +1 -1
- package/build/common/telemetry.js +1 -0
- package/build/common/telemetry.js.map +1 -1
- package/build/common/tools.d.ts +2 -36
- package/build/common/tools.d.ts.map +1 -1
- package/build/common/tools.js +7 -131
- package/build/common/tools.js.map +1 -1
- package/build/common/utils.d.ts +1 -0
- package/build/common/utils.d.ts.map +1 -1
- package/build/common/utils.js +6 -1
- package/build/common/utils.js.map +1 -1
- package/build/common/versionMetadata.d.ts +1 -3
- package/build/common/versionMetadata.d.ts.map +1 -1
- package/build/common/versionMetadata.js +2 -4
- package/build/common/versionMetadata.js.map +1 -1
- package/build/component/configManager/interface.d.ts +2 -0
- package/build/component/configManager/interface.d.ts.map +1 -1
- package/build/component/configManager/interface.js.map +1 -1
- package/build/component/configManager/lifecycle.d.ts +2 -1
- package/build/component/configManager/lifecycle.d.ts.map +1 -1
- package/build/component/configManager/lifecycle.js +3 -2
- package/build/component/configManager/lifecycle.js.map +1 -1
- package/build/component/configManager/parser.d.ts.map +1 -1
- package/build/component/configManager/parser.js +23 -17
- package/build/component/configManager/parser.js.map +1 -1
- package/build/component/configManager/validator.d.ts +18 -0
- package/build/component/configManager/validator.d.ts.map +1 -0
- package/build/component/configManager/validator.js +54 -0
- package/build/component/configManager/validator.js.map +1 -0
- package/build/component/constants.d.ts +0 -80
- package/build/component/constants.d.ts.map +1 -1
- package/build/component/constants.js +2 -90
- package/build/component/constants.js.map +1 -1
- package/build/component/coordinator/index.d.ts.map +1 -1
- package/build/component/coordinator/index.js +16 -10
- package/build/component/coordinator/index.js.map +1 -1
- package/build/component/driver/aad/update.d.ts.map +1 -1
- package/build/component/driver/aad/update.js.map +1 -1
- package/build/component/driver/aad/utility/buildAadManifest.d.ts.map +1 -1
- package/build/component/driver/aad/utility/buildAadManifest.js +0 -3
- package/build/component/driver/aad/utility/buildAadManifest.js.map +1 -1
- package/build/component/driver/arm/util/bicepChecker.d.ts +0 -1
- package/build/component/driver/arm/util/bicepChecker.d.ts.map +1 -1
- package/build/component/driver/arm/util/bicepChecker.js +3 -3
- package/build/component/driver/arm/util/bicepChecker.js.map +1 -1
- package/build/component/driver/deploy/azure/impl/AzureZipDeployImpl.js +1 -1
- package/build/component/driver/deploy/azure/impl/AzureZipDeployImpl.js.map +1 -1
- package/build/component/driver/file/createOrUpdateJsonFile.d.ts +4 -4
- package/build/component/driver/file/createOrUpdateJsonFile.d.ts.map +1 -1
- package/build/component/driver/file/createOrUpdateJsonFile.js +31 -28
- package/build/component/driver/file/createOrUpdateJsonFile.js.map +1 -1
- package/build/component/driver/file/interface/generateJsonArgs.d.ts +9 -0
- package/build/component/driver/file/interface/generateJsonArgs.d.ts.map +1 -0
- package/build/component/{debugHandler/common.js → driver/file/interface/generateJsonArgs.js} +2 -2
- package/build/component/driver/file/interface/generateJsonArgs.js.map +1 -0
- package/build/component/driver/index.d.ts +0 -1
- package/build/component/driver/index.d.ts.map +1 -1
- package/build/component/driver/index.js +0 -1
- package/build/component/driver/index.js.map +1 -1
- package/build/component/driver/interface/stepDriver.d.ts +2 -1
- package/build/component/driver/interface/stepDriver.d.ts.map +1 -1
- package/build/component/driver/teamsApp/publishAppPackage.d.ts.map +1 -1
- package/build/component/driver/teamsApp/publishAppPackage.js +1 -1
- package/build/component/driver/teamsApp/publishAppPackage.js.map +1 -1
- package/build/component/feature/sso.d.ts.map +1 -1
- package/build/component/feature/sso.js +1 -1
- package/build/component/feature/sso.js.map +1 -1
- package/build/component/generator/generator.d.ts.map +1 -1
- package/build/component/generator/generator.js +3 -4
- package/build/component/generator/generator.js.map +1 -1
- package/build/component/generator/spfx/utils/questions.d.ts +7 -2
- package/build/component/generator/spfx/utils/questions.d.ts.map +1 -1
- package/build/component/generator/spfx/utils/questions.js +37 -10
- package/build/component/generator/spfx/utils/questions.js.map +1 -1
- package/build/component/generator/utils.d.ts +1 -0
- package/build/component/generator/utils.d.ts.map +1 -1
- package/build/component/generator/utils.js +16 -1
- package/build/component/generator/utils.js.map +1 -1
- package/build/component/messages.d.ts +0 -61
- package/build/component/messages.d.ts.map +1 -1
- package/build/component/messages.js +1 -91
- package/build/component/messages.js.map +1 -1
- package/build/component/middleware/actionExecutionMW.d.ts +1 -3
- package/build/component/middleware/actionExecutionMW.d.ts.map +1 -1
- package/build/component/middleware/actionExecutionMW.js +11 -15
- package/build/component/middleware/actionExecutionMW.js.map +1 -1
- package/build/component/middleware/envMW.d.ts.map +1 -1
- package/build/component/middleware/envMW.js +2 -1
- package/build/component/middleware/envMW.js.map +1 -1
- package/build/component/middleware/questionMW.d.ts.map +1 -1
- package/build/component/middleware/questionMW.js +2 -1
- package/build/component/middleware/questionMW.js.map +1 -1
- package/build/component/migrate.d.ts +0 -6
- package/build/component/migrate.d.ts.map +1 -1
- package/build/component/migrate.js +31 -156
- package/build/component/migrate.js.map +1 -1
- package/build/component/provisionUtils.d.ts.map +1 -1
- package/build/component/provisionUtils.js +2 -1
- package/build/component/provisionUtils.js.map +1 -1
- package/build/component/question.d.ts.map +1 -1
- package/build/component/question.js +12 -12
- package/build/component/question.js.map +1 -1
- package/build/component/resource/aadApp/aadApp.d.ts +2 -56
- package/build/component/resource/aadApp/aadApp.d.ts.map +1 -1
- package/build/component/resource/aadApp/aadApp.js +0 -115
- package/build/component/resource/aadApp/aadApp.js.map +1 -1
- package/build/component/resource/aadApp/aadAppClient.d.ts +1 -17
- package/build/component/resource/aadApp/aadAppClient.d.ts.map +1 -1
- package/build/component/resource/aadApp/aadAppClient.js +0 -253
- package/build/component/resource/aadApp/aadAppClient.js.map +1 -1
- package/build/component/resource/aadApp/aadAppForTeamsImpl.d.ts +1 -17
- package/build/component/resource/aadApp/aadAppForTeamsImpl.d.ts.map +1 -1
- package/build/component/resource/aadApp/aadAppForTeamsImpl.js +4 -368
- package/build/component/resource/aadApp/aadAppForTeamsImpl.js.map +1 -1
- package/build/component/resource/aadApp/constants.d.ts +0 -94
- package/build/component/resource/aadApp/constants.d.ts.map +1 -1
- package/build/component/resource/aadApp/constants.js +1 -185
- package/build/component/resource/aadApp/constants.js.map +1 -1
- package/build/component/resource/aadApp/errors.d.ts +0 -38
- package/build/component/resource/aadApp/errors.d.ts.map +1 -1
- package/build/component/resource/aadApp/errors.js +1 -236
- package/build/component/resource/aadApp/errors.js.map +1 -1
- package/build/component/resource/aadApp/graph.d.ts +0 -6
- package/build/component/resource/aadApp/graph.d.ts.map +1 -1
- package/build/component/resource/aadApp/graph.js +0 -69
- package/build/component/resource/aadApp/graph.js.map +1 -1
- package/build/component/resource/aadApp/interfaces/AADApplication.d.ts +18 -20
- package/build/component/resource/aadApp/interfaces/AADApplication.d.ts.map +1 -1
- package/build/component/resource/aadApp/interfaces/AADApplication.js +4 -0
- package/build/component/resource/aadApp/interfaces/AADApplication.js.map +1 -1
- package/build/component/resource/aadApp/interfaces/AADManifest.d.ts +14 -16
- package/build/component/resource/aadApp/interfaces/AADManifest.d.ts.map +1 -1
- package/build/component/resource/aadApp/interfaces/AADManifest.js +4 -0
- package/build/component/resource/aadApp/interfaces/AADManifest.js.map +1 -1
- package/build/component/resource/aadApp/interfaces/IAADDefinition.d.ts +11 -10
- package/build/component/resource/aadApp/interfaces/IAADDefinition.d.ts.map +1 -1
- package/build/component/resource/aadApp/interfaces/IPermissionList.d.ts +4 -3
- package/build/component/resource/aadApp/interfaces/IPermissionList.d.ts.map +1 -1
- package/build/component/resource/aadApp/permissions/index.d.ts +0 -4
- package/build/component/resource/aadApp/permissions/index.d.ts.map +1 -1
- package/build/component/resource/aadApp/permissions/index.js +1 -32
- package/build/component/resource/aadApp/permissions/index.js.map +1 -1
- package/build/component/resource/aadApp/utils/configs.d.ts +0 -82
- package/build/component/resource/aadApp/utils/configs.d.ts.map +1 -1
- package/build/component/resource/aadApp/utils/configs.js +1 -560
- package/build/component/resource/aadApp/utils/configs.js.map +1 -1
- package/build/component/resource/aadApp/utils/telemetry.d.ts +0 -11
- package/build/component/resource/aadApp/utils/telemetry.d.ts.map +1 -1
- package/build/component/resource/aadApp/utils/telemetry.js +0 -14
- package/build/component/resource/aadApp/utils/telemetry.js.map +1 -1
- package/build/component/resource/aadApp/utils/tokenProvider.d.ts +3 -3
- package/build/component/resource/aadApp/utils/tokenProvider.d.ts.map +1 -1
- package/build/component/resource/aadApp/utils/tokenProvider.js +1 -26
- package/build/component/resource/aadApp/utils/tokenProvider.js.map +1 -1
- package/build/component/resource/aadApp/utils.d.ts +2 -4
- package/build/component/resource/aadApp/utils.d.ts.map +1 -1
- package/build/component/resource/aadApp/utils.js +11 -169
- package/build/component/resource/aadApp/utils.js.map +1 -1
- package/build/component/resource/appManifest/appStudio.d.ts.map +1 -1
- package/build/component/resource/appManifest/appStudio.js +2 -2
- package/build/component/resource/appManifest/appStudio.js.map +1 -1
- package/build/component/resource/botService/appStudio/appStudioClient.d.ts.map +1 -1
- package/build/component/resource/botService/appStudio/appStudioClient.js +1 -3
- package/build/component/resource/botService/appStudio/appStudioClient.js.map +1 -1
- package/build/component/resource/botService/botRegistration/botRegistration.d.ts.map +1 -1
- package/build/component/resource/botService/botRegistration/botRegistration.js +5 -4
- package/build/component/resource/botService/botRegistration/botRegistration.js.map +1 -1
- package/build/component/resource/botService/errors.d.ts +4 -0
- package/build/component/resource/botService/errors.d.ts.map +1 -1
- package/build/component/resource/botService/errors.js +16 -1
- package/build/component/resource/botService/errors.js.map +1 -1
- package/build/component/resource/botService/messages.d.ts +0 -3
- package/build/component/resource/botService/messages.d.ts.map +1 -1
- package/build/component/resource/botService/messages.js +0 -3
- package/build/component/resource/botService/messages.js.map +1 -1
- package/build/component/resource/botService/resourceNameFactory.d.ts.map +1 -1
- package/build/component/resource/botService/resourceNameFactory.js +2 -2
- package/build/component/resource/botService/resourceNameFactory.js.map +1 -1
- package/build/component/utils/ResourceGroupHelper.d.ts.map +1 -1
- package/build/component/utils/ResourceGroupHelper.js +4 -6
- package/build/component/utils/ResourceGroupHelper.js.map +1 -1
- package/build/component/utils/common.d.ts +0 -10
- package/build/component/utils/common.d.ts.map +1 -1
- package/build/component/utils/common.js +1 -11
- package/build/component/utils/common.js.map +1 -1
- package/build/component/utils/fileOperation.d.ts +0 -7
- package/build/component/utils/fileOperation.d.ts.map +1 -1
- package/build/component/utils/fileOperation.js +3 -27
- package/build/component/utils/fileOperation.js.map +1 -1
- package/build/component/utils/metadataUtil.d.ts.map +1 -1
- package/build/component/utils/metadataUtil.js +1 -0
- package/build/component/utils/metadataUtil.js.map +1 -1
- package/build/component/utils/pathUtils.d.ts.map +1 -1
- package/build/component/utils/pathUtils.js +1 -1
- package/build/component/utils/pathUtils.js.map +1 -1
- package/build/core/FxCore.d.ts +3 -18
- package/build/core/FxCore.d.ts.map +1 -1
- package/build/core/FxCore.js +11 -43
- package/build/core/FxCore.js.map +1 -1
- package/build/core/FxCoreImplementV3.d.ts +0 -4
- package/build/core/FxCoreImplementV3.d.ts.map +1 -1
- package/build/core/FxCoreImplementV3.js +1 -21
- package/build/core/FxCoreImplementV3.js.map +1 -1
- package/build/core/callback.d.ts +2 -1
- package/build/core/callback.d.ts.map +1 -1
- package/build/core/callback.js.map +1 -1
- package/build/core/environment.d.ts +1 -3
- package/build/core/environment.d.ts.map +1 -1
- package/build/core/environment.js +2 -43
- package/build/core/environment.js.map +1 -1
- package/build/core/error.d.ts +0 -3
- package/build/core/error.d.ts.map +1 -1
- package/build/core/error.js +1 -21
- package/build/core/error.js.map +1 -1
- package/build/core/middleware/concurrentLocker.d.ts.map +1 -1
- package/build/core/middleware/concurrentLocker.js +3 -3
- 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 +2 -1
- package/build/core/middleware/envInfoLoaderV3.js.map +1 -1
- package/build/core/middleware/errorHandler.d.ts.map +1 -1
- package/build/core/middleware/errorHandler.js +2 -1
- package/build/core/middleware/errorHandler.js.map +1 -1
- package/build/core/middleware/projectMigratorV3.d.ts +0 -17
- package/build/core/middleware/projectMigratorV3.d.ts.map +1 -1
- package/build/core/middleware/projectMigratorV3.js +40 -40
- package/build/core/middleware/projectMigratorV3.js.map +1 -1
- package/build/core/middleware/projectSettingsLoader.d.ts.map +1 -1
- package/build/core/middleware/projectSettingsLoader.js +2 -1
- package/build/core/middleware/projectSettingsLoader.js.map +1 -1
- package/build/core/middleware/questionModel.d.ts.map +1 -1
- package/build/core/middleware/questionModel.js +5 -4
- package/build/core/middleware/questionModel.js.map +1 -1
- package/build/core/middleware/utils/MigrationUtils.d.ts +0 -13
- package/build/core/middleware/utils/MigrationUtils.d.ts.map +1 -1
- package/build/core/middleware/utils/MigrationUtils.js +12 -12
- package/build/core/middleware/utils/MigrationUtils.js.map +1 -1
- package/build/core/middleware/utils/migrationContext.d.ts.map +1 -1
- package/build/core/middleware/utils/migrationContext.js.map +1 -1
- package/build/core/middleware/utils/v3MigrationUtils.d.ts +0 -3
- package/build/core/middleware/utils/v3MigrationUtils.d.ts.map +1 -1
- package/build/core/middleware/utils/v3MigrationUtils.js +1 -18
- package/build/core/middleware/utils/v3MigrationUtils.js.map +1 -1
- package/build/core/question.d.ts.map +1 -1
- package/build/core/question.js +2 -7
- package/build/core/question.js.map +1 -1
- package/build/error/azure.d.ts +3 -3
- package/build/error/azure.d.ts.map +1 -1
- package/build/error/azure.js +6 -6
- package/build/error/azure.js.map +1 -1
- package/build/error/common.d.ts +19 -3
- package/build/error/common.d.ts.map +1 -1
- package/build/error/common.js +71 -7
- package/build/error/common.js.map +1 -1
- package/build/error/index.d.ts +8 -0
- package/build/error/index.d.ts.map +1 -1
- package/build/error/index.js +10 -0
- package/build/error/index.js.map +1 -1
- package/build/index.d.ts +4 -1
- package/build/index.d.ts.map +1 -1
- package/build/index.js +4 -1
- package/build/index.js.map +1 -1
- package/build/ui/visitor.d.ts +7 -0
- package/build/ui/visitor.d.ts.map +1 -0
- package/build/ui/visitor.js +359 -0
- package/build/ui/visitor.js.map +1 -0
- package/package.json +7 -5
- package/resource/package.nls.json +12 -99
- package/resource/yaml-schema/1.1.0/yaml.schema.json +1463 -0
- package/templates/core/v3Migration/csharp.app.local.yml +4 -4
- package/templates/fallback/common.zip +0 -0
- package/templates/fallback/csharp.zip +0 -0
- package/templates/fallback/js.zip +0 -0
- package/templates/fallback/ts.zip +0 -0
- package/build/common/armInterface.d.ts +0 -17
- package/build/common/armInterface.d.ts.map +0 -1
- package/build/common/armInterface.js +0 -5
- package/build/common/armInterface.js.map +0 -1
- package/build/common/template-utils/templates.d.ts +0 -8
- package/build/common/template-utils/templates.d.ts.map +0 -1
- package/build/common/template-utils/templates.js +0 -27
- package/build/common/template-utils/templates.js.map +0 -1
- package/build/common/template-utils/templatesActions.d.ts +0 -42
- package/build/common/template-utils/templatesActions.d.ts.map +0 -1
- package/build/common/template-utils/templatesActions.js +0 -167
- package/build/common/template-utils/templatesActions.js.map +0 -1
- package/build/common/template-utils/templatesUtils.d.ts +0 -15
- package/build/common/template-utils/templatesUtils.d.ts.map +0 -1
- package/build/common/template-utils/templatesUtils.js +0 -120
- package/build/common/template-utils/templatesUtils.js.map +0 -1
- package/build/component/code/utils.d.ts +0 -2
- package/build/component/code/utils.d.ts.map +0 -1
- package/build/component/code/utils.js +0 -23
- package/build/component/code/utils.js.map +0 -1
- package/build/component/debugHandler/appManifest.d.ts +0 -24
- package/build/component/debugHandler/appManifest.d.ts.map +0 -1
- package/build/component/debugHandler/appManifest.js +0 -172
- package/build/component/debugHandler/appManifest.js.map +0 -1
- package/build/component/debugHandler/bot.d.ts +0 -28
- package/build/component/debugHandler/bot.d.ts.map +0 -1
- package/build/component/debugHandler/bot.js +0 -257
- package/build/component/debugHandler/bot.js.map +0 -1
- package/build/component/debugHandler/common.d.ts +0 -6
- package/build/component/debugHandler/common.d.ts.map +0 -1
- package/build/component/debugHandler/common.js.map +0 -1
- package/build/component/debugHandler/error.d.ts +0 -8
- package/build/component/debugHandler/error.d.ts.map +0 -1
- package/build/component/debugHandler/error.js +0 -31
- package/build/component/debugHandler/error.js.map +0 -1
- package/build/component/debugHandler/index.d.ts +0 -8
- package/build/component/debugHandler/index.d.ts.map +0 -1
- package/build/component/debugHandler/index.js +0 -13
- package/build/component/debugHandler/index.js.map +0 -1
- package/build/component/debugHandler/localEnvProvider.d.ts +0 -85
- package/build/component/debugHandler/localEnvProvider.d.ts.map +0 -1
- package/build/component/debugHandler/localEnvProvider.js +0 -172
- package/build/component/debugHandler/localEnvProvider.js.map +0 -1
- package/build/component/debugHandler/sso.d.ts +0 -29
- package/build/component/debugHandler/sso.d.ts.map +0 -1
- package/build/component/debugHandler/sso.js +0 -347
- package/build/component/debugHandler/sso.js.map +0 -1
- package/build/component/debugHandler/tab.d.ts +0 -22
- package/build/component/debugHandler/tab.d.ts.map +0 -1
- package/build/component/debugHandler/tab.js +0 -122
- package/build/component/debugHandler/tab.js.map +0 -1
- package/build/component/debugHandler/utils.d.ts +0 -3
- package/build/component/debugHandler/utils.d.ts.map +0 -1
- package/build/component/debugHandler/utils.js +0 -47
- package/build/component/debugHandler/utils.js.map +0 -1
- package/build/component/driver/aad/error/missingEnvInFileError.d.ts +0 -5
- package/build/component/driver/aad/error/missingEnvInFileError.d.ts.map +0 -1
- package/build/component/driver/aad/error/missingEnvInFileError.js +0 -33
- package/build/component/driver/aad/error/missingEnvInFileError.js.map +0 -1
- package/build/component/driver/aad/interface/progressBarSetting.d.ts +0 -5
- package/build/component/driver/aad/interface/progressBarSetting.d.ts.map +0 -1
- package/build/component/driver/aad/interface/progressBarSetting.js +0 -5
- package/build/component/driver/aad/interface/progressBarSetting.js.map +0 -1
- package/build/component/driver/file/createOrUpdateDebugProfile.d.ts +0 -11
- package/build/component/driver/file/createOrUpdateDebugProfile.d.ts.map +0 -1
- package/build/component/driver/file/createOrUpdateDebugProfile.js +0 -140
- package/build/component/driver/file/createOrUpdateDebugProfile.js.map +0 -1
- package/build/component/driver/file/interface/createOrUpdateDebugProfileArgs.d.ts +0 -7
- package/build/component/driver/file/interface/createOrUpdateDebugProfileArgs.d.ts.map +0 -1
- package/build/component/driver/file/interface/createOrUpdateDebugProfileArgs.js +0 -5
- package/build/component/driver/file/interface/createOrUpdateDebugProfileArgs.js.map +0 -1
- package/build/component/driver/file/interface/generateAppsettingsArgs.d.ts +0 -8
- package/build/component/driver/file/interface/generateAppsettingsArgs.d.ts.map +0 -1
- package/build/component/driver/file/interface/generateAppsettingsArgs.js +0 -5
- package/build/component/driver/file/interface/generateAppsettingsArgs.js.map +0 -1
- package/build/component/error.d.ts +0 -22
- package/build/component/error.d.ts.map +0 -1
- package/build/component/error.js +0 -64
- package/build/component/error.js.map +0 -1
- package/build/component/resource/aadApp/aadAppManifestManager.d.ts +0 -12
- package/build/component/resource/aadApp/aadAppManifestManager.d.ts.map +0 -1
- package/build/component/resource/aadApp/aadAppManifestManager.js +0 -151
- package/build/component/resource/aadApp/aadAppManifestManager.js.map +0 -1
- package/build/component/resource/aadApp/appStudio.d.ts +0 -9
- package/build/component/resource/aadApp/appStudio.d.ts.map +0 -1
- package/build/component/resource/aadApp/appStudio.js +0 -83
- package/build/component/resource/aadApp/appStudio.js.map +0 -1
- package/build/component/resource/aadApp/interfaces/IAADApplication.d.ts +0 -14
- package/build/component/resource/aadApp/interfaces/IAADApplication.d.ts.map +0 -1
- package/build/component/resource/aadApp/interfaces/IAADApplication.js +0 -5
- package/build/component/resource/aadApp/interfaces/IAADApplication.js.map +0 -1
- package/build/component/resource/aadApp/interfaces/IPermission.d.ts +0 -8
- package/build/component/resource/aadApp/interfaces/IPermission.d.ts.map +0 -1
- package/build/component/resource/aadApp/interfaces/IPermission.js +0 -5
- package/build/component/resource/aadApp/interfaces/IPermission.js.map +0 -1
- package/build/component/resource/aadApp/interfaces/models.d.ts +0 -11
- package/build/component/resource/aadApp/interfaces/models.d.ts.map +0 -1
- package/build/component/resource/aadApp/interfaces/models.js +0 -12
- package/build/component/resource/aadApp/interfaces/models.js.map +0 -1
- package/build/component/resource/aadApp/utils/format.d.ts +0 -7
- package/build/component/resource/aadApp/utils/format.d.ts.map +0 -1
- package/build/component/resource/aadApp/utils/format.js +0 -68
- package/build/component/resource/aadApp/utils/format.js.map +0 -1
- package/build/core/generateAadManifestTemplate.d.ts +0 -3
- package/build/core/generateAadManifestTemplate.d.ts.map +0 -1
- package/build/core/generateAadManifestTemplate.js +0 -136
- package/build/core/generateAadManifestTemplate.js.map +0 -1
- package/templates/bicep/aadApp.parameters.json +0 -6
- package/templates/bicep/apim.config.module.bicep +0 -65
- package/templates/bicep/apim.config.orchestration.bicep +0 -13
- package/templates/bicep/apim.parameters.json +0 -6
- package/templates/bicep/apim.provision.module.bicep +0 -38
- package/templates/bicep/apim.provision.orchestration.bicep +0 -13
- package/templates/bicep/azureFunction.config.module.bicep +0 -121
- package/templates/bicep/azureFunction.config.orchestration.bicep +0 -14
- package/templates/bicep/azureFunction.provision.module.bicep +0 -108
- package/templates/bicep/azureFunction.provision.orchestration.bicep +0 -23
- package/templates/bicep/azureStorage.provision.module.bicep +0 -25
- package/templates/bicep/azureStorage.provision.orchestration.bicep +0 -21
- package/templates/bicep/azureWebApp.config.module.bicep +0 -79
- package/templates/bicep/azureWebApp.config.orchestration.bicep +0 -12
- package/templates/bicep/azureWebApp.provision.module.bicep +0 -85
- package/templates/bicep/azureWebApp.provision.orchestration.bicep +0 -27
- package/templates/bicep/botService.parameters.json +0 -4
- package/templates/bicep/botService.provision.module.bicep +0 -33
- package/templates/bicep/botService.provision.orchestration.bicep +0 -8
- package/templates/bicep/config.bicep +0 -3
- package/templates/bicep/main.bicep +0 -18
- package/templates/bicep/provision.bicep +0 -2
- package/templates/plugins/resource/aad/bicep/parameters.json +0 -6
- package/templates/plugins/solution/README.md +0 -14
- package/templates/plugins/solution/config.bicep +0 -3
- package/templates/plugins/solution/mainConfig.bicep +0 -8
- package/templates/plugins/solution/mainProvision.bicep +0 -10
- package/templates/plugins/solution/provision.bicep +0 -2
- package/templates/plugins/solution/v1/README.md +0 -26
- /package/resource/{yaml.schema.json → yaml-schema/1.0.0/yaml.schema.json} +0 -0
|
@@ -1,84 +1,2 @@
|
|
|
1
|
-
import { ConfigValue, Result, FxError, v3, M365TokenProvider, LogProvider, PluginContext, v2 } from "@microsoft/teamsfx-api";
|
|
2
|
-
import { Messages } from "../constants";
|
|
3
|
-
import { IAADDefinition } from "../interfaces/IAADDefinition";
|
|
4
|
-
export declare class Utils {
|
|
5
|
-
static addLogAndTelemetryWithLocalDebug(logProvider: LogProvider | undefined, message: Messages, messageLocal: Messages, isLocalDebug?: boolean, properties?: {
|
|
6
|
-
[key: string]: string;
|
|
7
|
-
}): void;
|
|
8
|
-
static addLogAndTelemetry(logProvider: LogProvider | undefined, message: Messages, properties?: {
|
|
9
|
-
[key: string]: string;
|
|
10
|
-
}): void;
|
|
11
|
-
static addLocalDebugPrefix(isLocalDebug: boolean, key: string): string;
|
|
12
|
-
static getConfigFileName(envName?: string): string;
|
|
13
|
-
static getInputFileName(envName: string): string;
|
|
14
|
-
static getCurrentTenantId(m365TokenProvider?: M365TokenProvider): Promise<string>;
|
|
15
|
-
static skipCreateAadForProvision(envInfo: v3.EnvInfoV3): boolean;
|
|
16
|
-
static skipCreateAadForLocalProvision(localSettings: v2.LocalSettings): boolean;
|
|
17
|
-
static skipAADProvision(ctx: PluginContext, isLocalDebug?: boolean): boolean;
|
|
18
|
-
static parseRedirectUriMessage(redirectUris: IAADDefinition): string;
|
|
19
|
-
}
|
|
20
|
-
export declare class ConfigUtils {
|
|
21
|
-
static getAadConfig(ctx: PluginContext, key: string, isLocalDebug?: boolean): string | undefined;
|
|
22
|
-
static getLocalDebugConfigOfOtherPlugins(ctx: PluginContext, key: string): string | undefined;
|
|
23
|
-
static checkAndSaveConfig(ctx: PluginContext, key: string, value: ConfigValue, isLocalDebug?: boolean): void;
|
|
24
|
-
static getPermissionRequest(ctx: PluginContext): Promise<string>;
|
|
25
|
-
}
|
|
26
|
-
export declare class ProvisionConfig {
|
|
27
|
-
displayName?: string;
|
|
28
|
-
permissionRequest?: string;
|
|
29
|
-
clientId?: string;
|
|
30
|
-
password?: string;
|
|
31
|
-
objectId?: string;
|
|
32
|
-
oauth2PermissionScopeId?: string;
|
|
33
|
-
private isLocalDebug;
|
|
34
|
-
constructor(isLocalDebug?: boolean, generateScopeId?: boolean);
|
|
35
|
-
restoreConfigFromLocalSettings(ctx: v2.Context, inputs: v2.InputsWithProjectPath, localSettings: v2.LocalSettings): Promise<Result<any, FxError>>;
|
|
36
|
-
restoreConfigFromEnvInfo(ctx: v2.Context, inputs: v2.InputsWithProjectPath, envInfo: v3.EnvInfoV3): Promise<Result<any, FxError>>;
|
|
37
|
-
restoreConfigFromContext(ctx: PluginContext): Promise<void>;
|
|
38
|
-
saveConfigIntoContext(ctx: PluginContext, tenantId: string): void;
|
|
39
|
-
saveConfigIntoLocalSettings(localSettings: v2.LocalSettings, tenantId: string): void;
|
|
40
|
-
saveConfigIntoEnvInfo(envInfo: v3.EnvInfoV3, tenantId: string): void;
|
|
41
|
-
private static getOauthAuthority;
|
|
42
|
-
private setDisplayName;
|
|
43
|
-
}
|
|
44
|
-
export declare class SetApplicationInContextConfig {
|
|
45
|
-
frontendDomain?: string;
|
|
46
|
-
frontendEndpoint?: string;
|
|
47
|
-
botId?: string;
|
|
48
|
-
botEndpoint?: string;
|
|
49
|
-
clientId?: string;
|
|
50
|
-
applicationIdUri?: string;
|
|
51
|
-
private isLocalDebug;
|
|
52
|
-
constructor(isLocalDebug?: boolean);
|
|
53
|
-
restoreConfigFromContext(ctx: PluginContext): void;
|
|
54
|
-
restoreConfigFromLocalSettings(localSettings: v2.LocalSettings): void;
|
|
55
|
-
restoreConfigFromEnvInfo(ctx: v2.Context, envInfo: v3.EnvInfoV3): void;
|
|
56
|
-
saveConfigIntoContext(ctx: PluginContext, frontendDomain: string | undefined, botId: string | undefined, botEndpoint: string | undefined): void;
|
|
57
|
-
}
|
|
58
|
-
export declare class PostProvisionConfig {
|
|
59
|
-
frontendEndpoint?: string;
|
|
60
|
-
botEndpoint?: string;
|
|
61
|
-
objectId?: string;
|
|
62
|
-
clientId?: string;
|
|
63
|
-
applicationIdUri?: string;
|
|
64
|
-
private isLocalDebug;
|
|
65
|
-
constructor(isLocalDebug?: boolean);
|
|
66
|
-
restoreConfigFromLocalSettings(localSettings: v2.LocalSettings): void;
|
|
67
|
-
restoreConfigFromEnvInfo(ctx: v2.Context, envInfo: v3.EnvInfoV3): void;
|
|
68
|
-
restoreConfigFromContext(ctx: PluginContext): Promise<void>;
|
|
69
|
-
}
|
|
70
|
-
export declare class UpdatePermissionConfig {
|
|
71
|
-
objectId?: string;
|
|
72
|
-
permissionRequest?: string;
|
|
73
|
-
private isLocalDebug;
|
|
74
|
-
constructor(isLocalDebug?: boolean);
|
|
75
|
-
restoreConfigFromContext(ctx: PluginContext): Promise<void>;
|
|
76
|
-
}
|
|
77
|
-
export declare class CheckGrantPermissionConfig {
|
|
78
|
-
objectId?: string;
|
|
79
|
-
isGrantPermission: boolean;
|
|
80
|
-
constructor(isGrantPermission?: boolean);
|
|
81
|
-
restoreConfigFromContext(ctx: PluginContext): Promise<void>;
|
|
82
|
-
}
|
|
83
1
|
export declare function getPermissionErrorMessage(message: string, isGrantPermission?: boolean, objectId?: string): string;
|
|
84
2
|
//# sourceMappingURL=configs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configs.d.ts","sourceRoot":"","sources":["../../../../../src/component/resource/aadApp/utils/configs.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"configs.d.ts","sourceRoot":"","sources":["../../../../../src/component/resource/aadApp/utils/configs.ts"],"names":[],"mappings":"AAKA,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,MAAM,EACf,iBAAiB,UAAQ,EACzB,QAAQ,CAAC,EAAE,MAAM,GAChB,MAAM,CAIR"}
|
|
@@ -2,567 +2,8 @@
|
|
|
2
2
|
// Copyright (c) Microsoft Corporation.
|
|
3
3
|
// Licensed under the MIT license.
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.getPermissionErrorMessage =
|
|
6
|
-
const teamsfx_api_1 = require("@microsoft/teamsfx-api");
|
|
5
|
+
exports.getPermissionErrorMessage = void 0;
|
|
7
6
|
const constants_1 = require("../constants");
|
|
8
|
-
const errors_1 = require("../errors");
|
|
9
|
-
const format_1 = require("./format");
|
|
10
|
-
const uuid_1 = require("uuid");
|
|
11
|
-
const localSettingsConstants_1 = require("../../../../common/localSettingsConstants");
|
|
12
|
-
const telemetry_1 = require("./telemetry");
|
|
13
|
-
const results_1 = require("../results");
|
|
14
|
-
const permissions_1 = require("../permissions");
|
|
15
|
-
const utils_1 = require("../../../../common/utils");
|
|
16
|
-
const constants_2 = require("../../../../component/constants");
|
|
17
|
-
const tools_1 = require("../../../../common/tools");
|
|
18
|
-
const aadComponentKey = constants_2.ComponentNames.AadApp;
|
|
19
|
-
const tabComponentKey = constants_2.ComponentNames.TeamsTab;
|
|
20
|
-
const botComponentKey = constants_2.ComponentNames.TeamsBot;
|
|
21
|
-
class Utils {
|
|
22
|
-
static addLogAndTelemetryWithLocalDebug(logProvider, message, messageLocal, isLocalDebug = false, properties) {
|
|
23
|
-
if (!isLocalDebug) {
|
|
24
|
-
logProvider === null || logProvider === void 0 ? void 0 : logProvider.info(message.log);
|
|
25
|
-
telemetry_1.TelemetryUtils.sendSuccessEvent(message.telemetry, properties);
|
|
26
|
-
}
|
|
27
|
-
else {
|
|
28
|
-
logProvider === null || logProvider === void 0 ? void 0 : logProvider.info(messageLocal.log);
|
|
29
|
-
telemetry_1.TelemetryUtils.sendSuccessEvent(messageLocal.telemetry, properties);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
static addLogAndTelemetry(logProvider, message, properties) {
|
|
33
|
-
logProvider === null || logProvider === void 0 ? void 0 : logProvider.info(message.log);
|
|
34
|
-
telemetry_1.TelemetryUtils.sendSuccessEvent(message.telemetry, properties);
|
|
35
|
-
}
|
|
36
|
-
static addLocalDebugPrefix(isLocalDebug, key) {
|
|
37
|
-
return isLocalDebug ? constants_1.Constants.localDebugPrefix + key : key;
|
|
38
|
-
}
|
|
39
|
-
static getConfigFileName(envName) {
|
|
40
|
-
if (!envName) {
|
|
41
|
-
return constants_1.ConfigFilePath.LocalSettings;
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
44
|
-
return constants_1.ConfigFilePath.State(envName);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
static getInputFileName(envName) {
|
|
48
|
-
return constants_1.ConfigFilePath.Input(envName);
|
|
49
|
-
}
|
|
50
|
-
static async getCurrentTenantId(m365TokenProvider) {
|
|
51
|
-
var _a;
|
|
52
|
-
const tokenObjectRes = await (m365TokenProvider === null || m365TokenProvider === void 0 ? void 0 : m365TokenProvider.getJsonObject({ scopes: tools_1.GraphScopes }));
|
|
53
|
-
const tokenObject = (tokenObjectRes === null || tokenObjectRes === void 0 ? void 0 : tokenObjectRes.isOk()) ? tokenObjectRes.value : undefined;
|
|
54
|
-
const tenantId = (_a = tokenObject) === null || _a === void 0 ? void 0 : _a.tid;
|
|
55
|
-
return tenantId;
|
|
56
|
-
}
|
|
57
|
-
static skipCreateAadForProvision(envInfo) {
|
|
58
|
-
var _a, _b, _c, _d;
|
|
59
|
-
const envConfig = envInfo.config;
|
|
60
|
-
const envState = envInfo.state[aadComponentKey];
|
|
61
|
-
const objectId = (_a = envConfig.auth) === null || _a === void 0 ? void 0 : _a.objectId;
|
|
62
|
-
const clientId = (_b = envConfig.auth) === null || _b === void 0 ? void 0 : _b.clientId;
|
|
63
|
-
const clientSecret = (_c = envConfig.auth) === null || _c === void 0 ? void 0 : _c.clientSecret;
|
|
64
|
-
const oauth2PermissionScopeId = (_d = envConfig.auth) === null || _d === void 0 ? void 0 : _d.accessAsUserScopeId;
|
|
65
|
-
if (objectId && clientId && oauth2PermissionScopeId && clientSecret) {
|
|
66
|
-
envState.objectId = objectId;
|
|
67
|
-
envState.clientId = clientId;
|
|
68
|
-
envState.clientSecret = clientSecret;
|
|
69
|
-
envState.oauth2PermissionScopeId = oauth2PermissionScopeId;
|
|
70
|
-
return true;
|
|
71
|
-
}
|
|
72
|
-
else if (objectId || clientId || oauth2PermissionScopeId || clientSecret) {
|
|
73
|
-
throw results_1.ResultFactory.UserError(errors_1.GetSkipAppConfigError.name, errors_1.GetSkipAppConfigError.message(Utils.getInputFileName(envInfo.envName)));
|
|
74
|
-
}
|
|
75
|
-
else {
|
|
76
|
-
return false;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
static skipCreateAadForLocalProvision(localSettings) {
|
|
80
|
-
var _a, _b, _c, _d;
|
|
81
|
-
const objectId = (_a = localSettings.auth) === null || _a === void 0 ? void 0 : _a.objectId;
|
|
82
|
-
const clientId = (_b = localSettings.auth) === null || _b === void 0 ? void 0 : _b.clientId;
|
|
83
|
-
const clientSecret = (_c = localSettings.auth) === null || _c === void 0 ? void 0 : _c.clientSecret;
|
|
84
|
-
const oauth2PermissionScopeId = (_d = localSettings.auth) === null || _d === void 0 ? void 0 : _d.oauth2PermissionScopeId;
|
|
85
|
-
if (objectId && clientId && oauth2PermissionScopeId && clientSecret) {
|
|
86
|
-
return true;
|
|
87
|
-
}
|
|
88
|
-
else if (objectId || clientId || oauth2PermissionScopeId || clientSecret) {
|
|
89
|
-
throw results_1.ResultFactory.UserError(errors_1.GetSkipAppConfigError.name, errors_1.GetSkipAppConfigError.message(constants_1.ConfigFilePath.LocalSettings));
|
|
90
|
-
}
|
|
91
|
-
else {
|
|
92
|
-
return false;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
static skipAADProvision(ctx, isLocalDebug = false) {
|
|
96
|
-
var _a, _b, _c, _d;
|
|
97
|
-
const objectId = isLocalDebug
|
|
98
|
-
? ConfigUtils.getAadConfig(ctx, constants_1.ConfigKeys.objectId, true)
|
|
99
|
-
: (_a = ctx.envInfo.config.auth) === null || _a === void 0 ? void 0 : _a.objectId;
|
|
100
|
-
const clientId = isLocalDebug
|
|
101
|
-
? ConfigUtils.getAadConfig(ctx, constants_1.ConfigKeys.clientId, true)
|
|
102
|
-
: (_b = ctx.envInfo.config.auth) === null || _b === void 0 ? void 0 : _b.clientId;
|
|
103
|
-
const oauth2PermissionScopeId = isLocalDebug
|
|
104
|
-
? ConfigUtils.getAadConfig(ctx, constants_1.ConfigKeys.oauth2PermissionScopeId, true)
|
|
105
|
-
: (_c = ctx.envInfo.config.auth) === null || _c === void 0 ? void 0 : _c.accessAsUserScopeId;
|
|
106
|
-
const clientSecret = isLocalDebug
|
|
107
|
-
? ConfigUtils.getAadConfig(ctx, constants_1.ConfigKeys.clientSecret, true)
|
|
108
|
-
: (_d = ctx.envInfo.config.auth) === null || _d === void 0 ? void 0 : _d.clientSecret;
|
|
109
|
-
if (objectId && clientId && clientSecret) {
|
|
110
|
-
if (!isLocalDebug) {
|
|
111
|
-
ConfigUtils.checkAndSaveConfig(ctx, constants_1.ConfigKeys.objectId, objectId);
|
|
112
|
-
ConfigUtils.checkAndSaveConfig(ctx, constants_1.ConfigKeys.clientId, clientId);
|
|
113
|
-
ConfigUtils.checkAndSaveConfig(ctx, constants_1.ConfigKeys.clientSecret, clientSecret);
|
|
114
|
-
if (oauth2PermissionScopeId) {
|
|
115
|
-
ConfigUtils.checkAndSaveConfig(ctx, constants_1.ConfigKeys.oauth2PermissionScopeId, oauth2PermissionScopeId);
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
return true;
|
|
119
|
-
}
|
|
120
|
-
else if (objectId || clientId || clientSecret) {
|
|
121
|
-
throw results_1.ResultFactory.UserError(errors_1.GetSkipAppConfigError.name, errors_1.GetSkipAppConfigError.message(Utils.getInputFileName(ctx.envInfo.envName)));
|
|
122
|
-
}
|
|
123
|
-
else {
|
|
124
|
-
return false;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
static parseRedirectUriMessage(redirectUris) {
|
|
128
|
-
let message = "";
|
|
129
|
-
if (redirectUris.web && redirectUris.web.redirectUris) {
|
|
130
|
-
message += `Platform: Web, RedirectUri: ${redirectUris.web.redirectUris.join(",")}; `;
|
|
131
|
-
}
|
|
132
|
-
if (redirectUris.spa && redirectUris.spa.redirectUris) {
|
|
133
|
-
message += `Platform: Single Page Application, RedirectUri: ${redirectUris.spa.redirectUris.join(",")}; `;
|
|
134
|
-
}
|
|
135
|
-
return message;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
exports.Utils = Utils;
|
|
139
|
-
class ConfigUtils {
|
|
140
|
-
static getAadConfig(ctx, key, isLocalDebug = false) {
|
|
141
|
-
var _a, _b, _c;
|
|
142
|
-
if (isLocalDebug) {
|
|
143
|
-
return (_b = (_a = ctx.localSettings) === null || _a === void 0 ? void 0 : _a.auth) === null || _b === void 0 ? void 0 : _b.get(key);
|
|
144
|
-
}
|
|
145
|
-
else {
|
|
146
|
-
return (_c = ctx.envInfo.state.get(constants_1.Plugins.pluginNameComplex)) === null || _c === void 0 ? void 0 : _c.get(key);
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
static getLocalDebugConfigOfOtherPlugins(ctx, key) {
|
|
150
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
151
|
-
switch (key) {
|
|
152
|
-
case constants_1.ConfigKeysOfOtherPlugin.localDebugTabDomain:
|
|
153
|
-
return (_b = (_a = ctx.localSettings) === null || _a === void 0 ? void 0 : _a.frontend) === null || _b === void 0 ? void 0 : _b.get(localSettingsConstants_1.LocalSettingsFrontendKeys.TabDomain);
|
|
154
|
-
case constants_1.ConfigKeysOfOtherPlugin.localDebugTabEndpoint:
|
|
155
|
-
return (_d = (_c = ctx.localSettings) === null || _c === void 0 ? void 0 : _c.frontend) === null || _d === void 0 ? void 0 : _d.get(localSettingsConstants_1.LocalSettingsFrontendKeys.TabEndpoint);
|
|
156
|
-
case constants_1.ConfigKeysOfOtherPlugin.localDebugBotEndpoint:
|
|
157
|
-
return (_f = (_e = ctx.localSettings) === null || _e === void 0 ? void 0 : _e.bot) === null || _f === void 0 ? void 0 : _f.get(localSettingsConstants_1.LocalSettingsBotKeys.BotEndpoint);
|
|
158
|
-
case constants_1.ConfigKeysOfOtherPlugin.teamsBotIdLocal:
|
|
159
|
-
return (_h = (_g = ctx.localSettings) === null || _g === void 0 ? void 0 : _g.bot) === null || _h === void 0 ? void 0 : _h.get(localSettingsConstants_1.LocalSettingsBotKeys.BotId);
|
|
160
|
-
default:
|
|
161
|
-
return undefined;
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
static checkAndSaveConfig(ctx, key, value, isLocalDebug = false) {
|
|
165
|
-
var _a, _b, _c;
|
|
166
|
-
if (!value) {
|
|
167
|
-
return;
|
|
168
|
-
}
|
|
169
|
-
if (isLocalDebug) {
|
|
170
|
-
(_b = (_a = ctx.localSettings) === null || _a === void 0 ? void 0 : _a.auth) === null || _b === void 0 ? void 0 : _b.set(key, value);
|
|
171
|
-
}
|
|
172
|
-
else {
|
|
173
|
-
(_c = ctx.envInfo.state.get(constants_1.Plugins.pluginNameComplex)) === null || _c === void 0 ? void 0 : _c.set(key, value);
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
static async getPermissionRequest(ctx) {
|
|
177
|
-
if (ctx.permissionRequestProvider === undefined) {
|
|
178
|
-
throw results_1.ResultFactory.SystemError(errors_1.MissingPermissionsRequestProvider.name, errors_1.MissingPermissionsRequestProvider.message());
|
|
179
|
-
}
|
|
180
|
-
const permissionRequestResult = await ctx.permissionRequestProvider.getPermissionRequest();
|
|
181
|
-
if (permissionRequestResult.isOk()) {
|
|
182
|
-
return permissionRequestResult.value;
|
|
183
|
-
}
|
|
184
|
-
else {
|
|
185
|
-
throw permissionRequestResult.error;
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
exports.ConfigUtils = ConfigUtils;
|
|
190
|
-
class ProvisionConfig {
|
|
191
|
-
constructor(isLocalDebug = false, generateScopeId = true) {
|
|
192
|
-
this.isLocalDebug = isLocalDebug;
|
|
193
|
-
if (generateScopeId) {
|
|
194
|
-
this.oauth2PermissionScopeId = uuid_1.v4();
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
async restoreConfigFromLocalSettings(ctx, inputs, localSettings) {
|
|
198
|
-
var _a, _b;
|
|
199
|
-
this.setDisplayName(ctx.projectSetting.appName);
|
|
200
|
-
const permissionRes = await permissions_1.getPermissionRequest(inputs.projectPath);
|
|
201
|
-
if (permissionRes.isErr()) {
|
|
202
|
-
return teamsfx_api_1.err(permissionRes.error);
|
|
203
|
-
}
|
|
204
|
-
this.permissionRequest = permissionRes.value;
|
|
205
|
-
const objectId = (_a = localSettings.auth) === null || _a === void 0 ? void 0 : _a.objectId;
|
|
206
|
-
if (objectId) {
|
|
207
|
-
this.objectId = objectId;
|
|
208
|
-
}
|
|
209
|
-
const clientSecret = (_b = localSettings.auth) === null || _b === void 0 ? void 0 : _b.clientSecret;
|
|
210
|
-
if (clientSecret) {
|
|
211
|
-
this.password = clientSecret;
|
|
212
|
-
}
|
|
213
|
-
return teamsfx_api_1.ok(undefined);
|
|
214
|
-
}
|
|
215
|
-
async restoreConfigFromEnvInfo(ctx, inputs, envInfo) {
|
|
216
|
-
this.setDisplayName(ctx.projectSetting.appName);
|
|
217
|
-
const permissionRes = await permissions_1.getPermissionRequest(inputs.projectPath);
|
|
218
|
-
if (permissionRes.isErr()) {
|
|
219
|
-
return teamsfx_api_1.err(permissionRes.error);
|
|
220
|
-
}
|
|
221
|
-
this.permissionRequest = permissionRes.value;
|
|
222
|
-
const aadResource = envInfo.state[aadComponentKey];
|
|
223
|
-
const objectId = aadResource === null || aadResource === void 0 ? void 0 : aadResource.objectId;
|
|
224
|
-
if (objectId) {
|
|
225
|
-
this.objectId = objectId;
|
|
226
|
-
}
|
|
227
|
-
const clientSecret = aadResource === null || aadResource === void 0 ? void 0 : aadResource.clientSecret;
|
|
228
|
-
if (clientSecret) {
|
|
229
|
-
this.password = clientSecret;
|
|
230
|
-
}
|
|
231
|
-
return teamsfx_api_1.ok(undefined);
|
|
232
|
-
}
|
|
233
|
-
async restoreConfigFromContext(ctx) {
|
|
234
|
-
this.setDisplayName(ctx.projectSettings.appName);
|
|
235
|
-
if (!tools_1.isAadManifestEnabled()) {
|
|
236
|
-
this.permissionRequest = await ConfigUtils.getPermissionRequest(ctx);
|
|
237
|
-
}
|
|
238
|
-
const objectId = ConfigUtils.getAadConfig(ctx, constants_1.ConfigKeys.objectId, this.isLocalDebug);
|
|
239
|
-
if (objectId) {
|
|
240
|
-
this.objectId = objectId;
|
|
241
|
-
}
|
|
242
|
-
const clientSecret = ConfigUtils.getAadConfig(ctx, constants_1.ConfigKeys.clientSecret, this.isLocalDebug);
|
|
243
|
-
if (clientSecret) {
|
|
244
|
-
this.password = clientSecret;
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
saveConfigIntoContext(ctx, tenantId) {
|
|
248
|
-
const oauthAuthority = ProvisionConfig.getOauthAuthority(tenantId);
|
|
249
|
-
ConfigUtils.checkAndSaveConfig(ctx, constants_1.ConfigKeys.clientId, this.clientId, this.isLocalDebug);
|
|
250
|
-
ConfigUtils.checkAndSaveConfig(ctx, constants_1.ConfigKeys.clientSecret, this.password, this.isLocalDebug);
|
|
251
|
-
ConfigUtils.checkAndSaveConfig(ctx, constants_1.ConfigKeys.objectId, this.objectId, this.isLocalDebug);
|
|
252
|
-
ConfigUtils.checkAndSaveConfig(ctx, constants_1.ConfigKeys.oauth2PermissionScopeId, this.oauth2PermissionScopeId, this.isLocalDebug);
|
|
253
|
-
ConfigUtils.checkAndSaveConfig(ctx, constants_1.ConfigKeys.tenantId, tenantId, this.isLocalDebug);
|
|
254
|
-
ConfigUtils.checkAndSaveConfig(ctx, constants_1.ConfigKeys.oauthHost, constants_1.Constants.oauthAuthorityPrefix, this.isLocalDebug);
|
|
255
|
-
ConfigUtils.checkAndSaveConfig(ctx, constants_1.ConfigKeys.oauthAuthority, oauthAuthority, this.isLocalDebug);
|
|
256
|
-
}
|
|
257
|
-
saveConfigIntoLocalSettings(localSettings, tenantId) {
|
|
258
|
-
const oauthAuthority = ProvisionConfig.getOauthAuthority(tenantId);
|
|
259
|
-
if (!localSettings.auth) {
|
|
260
|
-
localSettings.auth = {};
|
|
261
|
-
}
|
|
262
|
-
if (localSettings.auth) {
|
|
263
|
-
if (this.clientId)
|
|
264
|
-
localSettings.auth.clientId = this.clientId;
|
|
265
|
-
if (this.password)
|
|
266
|
-
localSettings.auth.clientSecret = this.password;
|
|
267
|
-
if (this.objectId)
|
|
268
|
-
localSettings.auth.objectId = this.objectId;
|
|
269
|
-
if (this.oauth2PermissionScopeId)
|
|
270
|
-
localSettings.auth.oauth2PermissionScopeId = this.oauth2PermissionScopeId;
|
|
271
|
-
localSettings.auth.tenantId = tenantId;
|
|
272
|
-
localSettings.auth.oauthHost = constants_1.Constants.oauthAuthorityPrefix;
|
|
273
|
-
localSettings.auth.oauthAuthority = oauthAuthority;
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
saveConfigIntoEnvInfo(envInfo, tenantId) {
|
|
277
|
-
if (!envInfo.state[aadComponentKey]) {
|
|
278
|
-
envInfo.state[aadComponentKey] = {};
|
|
279
|
-
envInfo.state[aadComponentKey].secretFields = ["clientSecret"];
|
|
280
|
-
}
|
|
281
|
-
const envState = envInfo.state[aadComponentKey];
|
|
282
|
-
const oauthAuthority = ProvisionConfig.getOauthAuthority(tenantId);
|
|
283
|
-
if (this.clientId)
|
|
284
|
-
envState.clientId = this.clientId;
|
|
285
|
-
if (this.password)
|
|
286
|
-
envState.clientSecret = this.password;
|
|
287
|
-
if (this.objectId)
|
|
288
|
-
envState.objectId = this.objectId;
|
|
289
|
-
if (this.oauth2PermissionScopeId)
|
|
290
|
-
envState.oauth2PermissionScopeId = this.oauth2PermissionScopeId;
|
|
291
|
-
envState.tenantId = tenantId;
|
|
292
|
-
envState.oauthHost = constants_1.Constants.oauthAuthorityPrefix;
|
|
293
|
-
envState.oauthAuthority = oauthAuthority;
|
|
294
|
-
}
|
|
295
|
-
static getOauthAuthority(tenantId) {
|
|
296
|
-
return `${constants_1.Constants.oauthAuthorityPrefix}/${tenantId}`;
|
|
297
|
-
}
|
|
298
|
-
setDisplayName(appName) {
|
|
299
|
-
const displayName = utils_1.convertToAlphanumericOnly(appName);
|
|
300
|
-
if (displayName) {
|
|
301
|
-
this.displayName = displayName.substr(0, constants_1.Constants.aadAppMaxLength);
|
|
302
|
-
}
|
|
303
|
-
else {
|
|
304
|
-
throw results_1.ResultFactory.SystemError(errors_1.GetConfigError.name, errors_1.GetConfigError.message(errors_1.ConfigErrorMessages.GetDisplayNameError[0]));
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
exports.ProvisionConfig = ProvisionConfig;
|
|
309
|
-
class SetApplicationInContextConfig {
|
|
310
|
-
constructor(isLocalDebug = false) {
|
|
311
|
-
this.isLocalDebug = isLocalDebug;
|
|
312
|
-
}
|
|
313
|
-
restoreConfigFromContext(ctx) {
|
|
314
|
-
var _a, _b, _c, _d;
|
|
315
|
-
let frontendDomain;
|
|
316
|
-
let frontendEndpoint;
|
|
317
|
-
if (this.isLocalDebug) {
|
|
318
|
-
frontendDomain = ConfigUtils.getLocalDebugConfigOfOtherPlugins(ctx, constants_1.ConfigKeysOfOtherPlugin.localDebugTabDomain);
|
|
319
|
-
}
|
|
320
|
-
else {
|
|
321
|
-
frontendDomain = ctx.config.get(constants_1.ConfigKeys.domain);
|
|
322
|
-
if (!frontendDomain) {
|
|
323
|
-
frontendDomain = (_a = ctx.envInfo.state
|
|
324
|
-
.get(constants_1.Plugins.frontendHosting)) === null || _a === void 0 ? void 0 : _a.get(constants_1.ConfigKeysOfOtherPlugin.frontendHostingDomain);
|
|
325
|
-
frontendEndpoint = (_b = ctx.envInfo.state
|
|
326
|
-
.get(constants_1.Plugins.frontendHosting)) === null || _b === void 0 ? void 0 : _b.get(constants_1.ConfigKeysOfOtherPlugin.frontendHostingEndpoint);
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
if (frontendEndpoint) {
|
|
330
|
-
this.frontendEndpoint = format_1.format(frontendEndpoint, format_1.Formats.Endpoint);
|
|
331
|
-
}
|
|
332
|
-
if (frontendDomain) {
|
|
333
|
-
this.frontendDomain = format_1.format(frontendDomain, format_1.Formats.Domain);
|
|
334
|
-
}
|
|
335
|
-
const botId = this.isLocalDebug
|
|
336
|
-
? ConfigUtils.getLocalDebugConfigOfOtherPlugins(ctx, constants_1.ConfigKeysOfOtherPlugin.teamsBotIdLocal)
|
|
337
|
-
: (_c = ctx.envInfo.state.get(constants_1.Plugins.teamsBot)) === null || _c === void 0 ? void 0 : _c.get(constants_1.ConfigKeysOfOtherPlugin.teamsBotId);
|
|
338
|
-
if (botId) {
|
|
339
|
-
this.botId = format_1.format(botId, format_1.Formats.UUID);
|
|
340
|
-
}
|
|
341
|
-
if (tools_1.isAadManifestEnabled()) {
|
|
342
|
-
const botEndpoint = (_d = ctx.envInfo.state
|
|
343
|
-
.get(constants_1.Plugins.teamsBot)) === null || _d === void 0 ? void 0 : _d.get(constants_1.ConfigKeysOfOtherPlugin.teamsBotEndpoint);
|
|
344
|
-
if (botEndpoint) {
|
|
345
|
-
this.botEndpoint = format_1.format(botEndpoint, format_1.Formats.Endpoint);
|
|
346
|
-
}
|
|
347
|
-
}
|
|
348
|
-
const clientId = ConfigUtils.getAadConfig(ctx, constants_1.ConfigKeys.clientId, this.isLocalDebug);
|
|
349
|
-
if (clientId) {
|
|
350
|
-
this.clientId = clientId;
|
|
351
|
-
}
|
|
352
|
-
else {
|
|
353
|
-
throw results_1.ResultFactory.SystemError(errors_1.GetConfigError.name, errors_1.GetConfigError.message(errors_1.ConfigErrorMessages.GetConfigError(constants_1.ConfigKeys.clientId, constants_1.Plugins.pluginName)[0]));
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
restoreConfigFromLocalSettings(localSettings) {
|
|
357
|
-
var _a, _b, _c;
|
|
358
|
-
const frontendDomain = (_a = localSettings.frontend) === null || _a === void 0 ? void 0 : _a.tabDomain;
|
|
359
|
-
if (frontendDomain) {
|
|
360
|
-
this.frontendDomain = format_1.format(frontendDomain, format_1.Formats.Domain);
|
|
361
|
-
}
|
|
362
|
-
const botId = (_b = localSettings.bot) === null || _b === void 0 ? void 0 : _b.botId;
|
|
363
|
-
if (botId) {
|
|
364
|
-
this.botId = format_1.format(botId, format_1.Formats.UUID);
|
|
365
|
-
}
|
|
366
|
-
const clientId = (_c = localSettings.auth) === null || _c === void 0 ? void 0 : _c.clientId;
|
|
367
|
-
if (clientId) {
|
|
368
|
-
this.clientId = clientId;
|
|
369
|
-
}
|
|
370
|
-
else {
|
|
371
|
-
throw results_1.ResultFactory.SystemError(errors_1.GetConfigError.name, errors_1.GetConfigError.message(errors_1.ConfigErrorMessages.GetConfigError(constants_1.ConfigKeys.clientId, constants_1.Plugins.pluginName)[0]));
|
|
372
|
-
}
|
|
373
|
-
}
|
|
374
|
-
restoreConfigFromEnvInfo(ctx, envInfo) {
|
|
375
|
-
var _a, _b;
|
|
376
|
-
const aadResource = envInfo.state[aadComponentKey];
|
|
377
|
-
let frontendDomain = aadResource === null || aadResource === void 0 ? void 0 : aadResource.domain;
|
|
378
|
-
if (!frontendDomain) {
|
|
379
|
-
frontendDomain = (_a = envInfo.state[tabComponentKey]) === null || _a === void 0 ? void 0 : _a.domain;
|
|
380
|
-
}
|
|
381
|
-
if (frontendDomain) {
|
|
382
|
-
this.frontendDomain = format_1.format(frontendDomain, format_1.Formats.Domain);
|
|
383
|
-
}
|
|
384
|
-
const botId = (_b = envInfo.state[botComponentKey]) === null || _b === void 0 ? void 0 : _b.botId;
|
|
385
|
-
if (botId) {
|
|
386
|
-
this.botId = format_1.format(botId, format_1.Formats.UUID);
|
|
387
|
-
}
|
|
388
|
-
const clientId = aadResource === null || aadResource === void 0 ? void 0 : aadResource.clientId;
|
|
389
|
-
if (clientId) {
|
|
390
|
-
this.clientId = clientId;
|
|
391
|
-
}
|
|
392
|
-
else {
|
|
393
|
-
throw results_1.ResultFactory.SystemError(errors_1.GetConfigError.name, errors_1.GetConfigError.message(errors_1.ConfigErrorMessages.GetConfigError(constants_1.ConfigKeys.clientId, constants_1.Plugins.pluginName)[0]));
|
|
394
|
-
}
|
|
395
|
-
}
|
|
396
|
-
saveConfigIntoContext(ctx, frontendDomain, botId, botEndpoint) {
|
|
397
|
-
ConfigUtils.checkAndSaveConfig(ctx, constants_1.ConfigKeys.applicationIdUri, this.applicationIdUri, this.isLocalDebug);
|
|
398
|
-
if (tools_1.isAadManifestEnabled()) {
|
|
399
|
-
ConfigUtils.checkAndSaveConfig(ctx, constants_1.ConfigKeys.botId, botId);
|
|
400
|
-
ConfigUtils.checkAndSaveConfig(ctx, constants_1.ConfigKeys.botEndpoint, botEndpoint);
|
|
401
|
-
if (frontendDomain) {
|
|
402
|
-
ConfigUtils.checkAndSaveConfig(ctx, constants_1.ConfigKeys.frontendEndpoint, `https://${frontendDomain}`);
|
|
403
|
-
}
|
|
404
|
-
}
|
|
405
|
-
}
|
|
406
|
-
}
|
|
407
|
-
exports.SetApplicationInContextConfig = SetApplicationInContextConfig;
|
|
408
|
-
class PostProvisionConfig {
|
|
409
|
-
constructor(isLocalDebug = false) {
|
|
410
|
-
this.isLocalDebug = isLocalDebug;
|
|
411
|
-
}
|
|
412
|
-
restoreConfigFromLocalSettings(localSettings) {
|
|
413
|
-
var _a, _b, _c, _d, _e;
|
|
414
|
-
const frontendEndpoint = (_a = localSettings.frontend) === null || _a === void 0 ? void 0 : _a.tabEndpoint;
|
|
415
|
-
if (frontendEndpoint) {
|
|
416
|
-
this.frontendEndpoint = format_1.format(frontendEndpoint, format_1.Formats.Endpoint);
|
|
417
|
-
}
|
|
418
|
-
const botEndpoint = (_b = localSettings.bot) === null || _b === void 0 ? void 0 : _b.botEndpoint;
|
|
419
|
-
if (botEndpoint) {
|
|
420
|
-
this.botEndpoint = format_1.format(botEndpoint, format_1.Formats.Endpoint);
|
|
421
|
-
}
|
|
422
|
-
const objectId = (_c = localSettings.auth) === null || _c === void 0 ? void 0 : _c.objectId;
|
|
423
|
-
if (objectId) {
|
|
424
|
-
this.objectId = objectId;
|
|
425
|
-
}
|
|
426
|
-
if (objectId) {
|
|
427
|
-
this.objectId = objectId;
|
|
428
|
-
}
|
|
429
|
-
else {
|
|
430
|
-
throw results_1.ResultFactory.SystemError(errors_1.GetConfigError.name, errors_1.GetConfigError.message(errors_1.ConfigErrorMessages.GetConfigError(constants_1.ConfigKeys.objectId, constants_1.Plugins.pluginName)[0]));
|
|
431
|
-
}
|
|
432
|
-
const applicationIdUri = (_d = localSettings.auth) === null || _d === void 0 ? void 0 : _d.applicationIdUris;
|
|
433
|
-
if (applicationIdUri) {
|
|
434
|
-
this.applicationIdUri = applicationIdUri;
|
|
435
|
-
}
|
|
436
|
-
else {
|
|
437
|
-
throw results_1.ResultFactory.SystemError(errors_1.GetConfigError.name, errors_1.GetConfigError.message(errors_1.ConfigErrorMessages.GetConfigError(constants_1.ConfigKeys.applicationIdUri, constants_1.Plugins.pluginName)[0]));
|
|
438
|
-
}
|
|
439
|
-
const clientId = (_e = localSettings.auth) === null || _e === void 0 ? void 0 : _e.clientId;
|
|
440
|
-
if (objectId) {
|
|
441
|
-
this.clientId = clientId;
|
|
442
|
-
}
|
|
443
|
-
else {
|
|
444
|
-
throw results_1.ResultFactory.SystemError(errors_1.GetConfigError.name, errors_1.GetConfigError.message(errors_1.ConfigErrorMessages.GetConfigError(constants_1.ConfigKeys.clientId, constants_1.Plugins.pluginName)[0]));
|
|
445
|
-
}
|
|
446
|
-
}
|
|
447
|
-
restoreConfigFromEnvInfo(ctx, envInfo) {
|
|
448
|
-
var _a, _b;
|
|
449
|
-
const aadResource = envInfo.state[aadComponentKey];
|
|
450
|
-
let frontendEndpoint = aadResource === null || aadResource === void 0 ? void 0 : aadResource.endpoint;
|
|
451
|
-
if (!frontendEndpoint) {
|
|
452
|
-
frontendEndpoint = (_a = envInfo.state[tabComponentKey]) === null || _a === void 0 ? void 0 : _a.endpoint;
|
|
453
|
-
}
|
|
454
|
-
if (frontendEndpoint) {
|
|
455
|
-
this.frontendEndpoint = format_1.format(frontendEndpoint, format_1.Formats.Endpoint);
|
|
456
|
-
}
|
|
457
|
-
const botEndpoint = (_b = envInfo.state[botComponentKey]) === null || _b === void 0 ? void 0 : _b.siteEndpoint;
|
|
458
|
-
if (botEndpoint) {
|
|
459
|
-
this.botEndpoint = format_1.format(botEndpoint, format_1.Formats.Endpoint);
|
|
460
|
-
}
|
|
461
|
-
const objectId = aadResource === null || aadResource === void 0 ? void 0 : aadResource.objectId;
|
|
462
|
-
if (objectId) {
|
|
463
|
-
this.objectId = objectId;
|
|
464
|
-
}
|
|
465
|
-
if (objectId) {
|
|
466
|
-
this.objectId = objectId;
|
|
467
|
-
}
|
|
468
|
-
else {
|
|
469
|
-
throw results_1.ResultFactory.SystemError(errors_1.GetConfigError.name, errors_1.GetConfigError.message(errors_1.ConfigErrorMessages.GetConfigError(constants_1.ConfigKeys.objectId, constants_1.Plugins.pluginName)[0]));
|
|
470
|
-
}
|
|
471
|
-
const applicationIdUri = aadResource === null || aadResource === void 0 ? void 0 : aadResource.applicationIdUris;
|
|
472
|
-
if (applicationIdUri) {
|
|
473
|
-
this.applicationIdUri = applicationIdUri;
|
|
474
|
-
}
|
|
475
|
-
else {
|
|
476
|
-
throw results_1.ResultFactory.SystemError(errors_1.GetConfigError.name, errors_1.GetConfigError.message(errors_1.ConfigErrorMessages.GetConfigError(constants_1.ConfigKeys.applicationIdUri, constants_1.Plugins.pluginName)[0]));
|
|
477
|
-
}
|
|
478
|
-
const clientId = aadResource === null || aadResource === void 0 ? void 0 : aadResource.clientId;
|
|
479
|
-
if (clientId) {
|
|
480
|
-
this.clientId = clientId;
|
|
481
|
-
}
|
|
482
|
-
else {
|
|
483
|
-
throw results_1.ResultFactory.SystemError(errors_1.GetConfigError.name, errors_1.GetConfigError.message(errors_1.ConfigErrorMessages.GetConfigError(constants_1.ConfigKeys.clientId, constants_1.Plugins.pluginName)[0]));
|
|
484
|
-
}
|
|
485
|
-
}
|
|
486
|
-
async restoreConfigFromContext(ctx) {
|
|
487
|
-
var _a, _b;
|
|
488
|
-
let frontendEndpoint;
|
|
489
|
-
if (this.isLocalDebug) {
|
|
490
|
-
frontendEndpoint = ConfigUtils.getLocalDebugConfigOfOtherPlugins(ctx, constants_1.ConfigKeysOfOtherPlugin.localDebugTabEndpoint);
|
|
491
|
-
}
|
|
492
|
-
else {
|
|
493
|
-
frontendEndpoint = ctx.config.get(constants_1.ConfigKeys.endpoint);
|
|
494
|
-
if (!frontendEndpoint) {
|
|
495
|
-
frontendEndpoint = (_a = ctx.envInfo.state
|
|
496
|
-
.get(constants_1.Plugins.frontendHosting)) === null || _a === void 0 ? void 0 : _a.get(constants_1.ConfigKeysOfOtherPlugin.frontendHostingEndpoint);
|
|
497
|
-
}
|
|
498
|
-
}
|
|
499
|
-
if (frontendEndpoint) {
|
|
500
|
-
this.frontendEndpoint = format_1.format(frontendEndpoint, format_1.Formats.Endpoint);
|
|
501
|
-
}
|
|
502
|
-
const botEndpoint = this.isLocalDebug
|
|
503
|
-
? ConfigUtils.getLocalDebugConfigOfOtherPlugins(ctx, constants_1.ConfigKeysOfOtherPlugin.localDebugBotEndpoint)
|
|
504
|
-
: (_b = ctx.envInfo.state.get(constants_1.Plugins.teamsBot)) === null || _b === void 0 ? void 0 : _b.get(constants_1.ConfigKeysOfOtherPlugin.teamsBotEndpoint);
|
|
505
|
-
if (botEndpoint) {
|
|
506
|
-
this.botEndpoint = format_1.format(botEndpoint, format_1.Formats.Endpoint);
|
|
507
|
-
}
|
|
508
|
-
const objectId = ConfigUtils.getAadConfig(ctx, constants_1.ConfigKeys.objectId, this.isLocalDebug);
|
|
509
|
-
if (objectId) {
|
|
510
|
-
this.objectId = objectId;
|
|
511
|
-
}
|
|
512
|
-
else {
|
|
513
|
-
throw results_1.ResultFactory.SystemError(errors_1.GetConfigError.name, errors_1.GetConfigError.message(errors_1.ConfigErrorMessages.GetConfigError(constants_1.ConfigKeys.objectId, constants_1.Plugins.pluginName)[0]));
|
|
514
|
-
}
|
|
515
|
-
const applicationIdUri = ConfigUtils.getAadConfig(ctx, constants_1.ConfigKeys.applicationIdUri, this.isLocalDebug);
|
|
516
|
-
if (applicationIdUri) {
|
|
517
|
-
this.applicationIdUri = applicationIdUri;
|
|
518
|
-
}
|
|
519
|
-
else {
|
|
520
|
-
throw results_1.ResultFactory.SystemError(errors_1.GetConfigError.name, errors_1.GetConfigError.message(errors_1.ConfigErrorMessages.GetConfigError(constants_1.ConfigKeys.applicationIdUri, constants_1.Plugins.pluginName)[0]));
|
|
521
|
-
}
|
|
522
|
-
const clientId = ConfigUtils.getAadConfig(ctx, constants_1.ConfigKeys.clientId, this.isLocalDebug);
|
|
523
|
-
if (clientId) {
|
|
524
|
-
this.clientId = clientId;
|
|
525
|
-
}
|
|
526
|
-
else {
|
|
527
|
-
throw results_1.ResultFactory.SystemError(errors_1.GetConfigError.name, errors_1.GetConfigError.message(errors_1.ConfigErrorMessages.GetConfigError(constants_1.ConfigKeys.clientId, constants_1.Plugins.pluginName)[0]));
|
|
528
|
-
}
|
|
529
|
-
}
|
|
530
|
-
}
|
|
531
|
-
exports.PostProvisionConfig = PostProvisionConfig;
|
|
532
|
-
class UpdatePermissionConfig {
|
|
533
|
-
constructor(isLocalDebug = false) {
|
|
534
|
-
this.isLocalDebug = isLocalDebug;
|
|
535
|
-
}
|
|
536
|
-
async restoreConfigFromContext(ctx) {
|
|
537
|
-
const objectId = ConfigUtils.getAadConfig(ctx, constants_1.ConfigKeys.objectId, this.isLocalDebug);
|
|
538
|
-
if (objectId) {
|
|
539
|
-
this.objectId = objectId;
|
|
540
|
-
}
|
|
541
|
-
else {
|
|
542
|
-
throw results_1.ResultFactory.SystemError(errors_1.GetConfigError.name, errors_1.GetConfigError.message(errors_1.ConfigErrorMessages.GetConfigError(constants_1.ConfigKeys.objectId, constants_1.Plugins.pluginName)[0]));
|
|
543
|
-
}
|
|
544
|
-
this.permissionRequest = await ConfigUtils.getPermissionRequest(ctx);
|
|
545
|
-
}
|
|
546
|
-
}
|
|
547
|
-
exports.UpdatePermissionConfig = UpdatePermissionConfig;
|
|
548
|
-
class CheckGrantPermissionConfig {
|
|
549
|
-
constructor(isGrantPermission = false) {
|
|
550
|
-
this.isGrantPermission = isGrantPermission;
|
|
551
|
-
}
|
|
552
|
-
async restoreConfigFromContext(ctx) {
|
|
553
|
-
var _a;
|
|
554
|
-
const objectId = (_a = ctx.config) === null || _a === void 0 ? void 0 : _a.get(constants_1.ConfigKeys.objectId);
|
|
555
|
-
if (objectId) {
|
|
556
|
-
this.objectId = objectId;
|
|
557
|
-
}
|
|
558
|
-
else {
|
|
559
|
-
const msg = getPermissionErrorMessage(errors_1.ConfigErrorMessages.GetConfigError(constants_1.ConfigKeys.objectId, constants_1.Plugins.pluginName)[0], this.isGrantPermission);
|
|
560
|
-
const msg1 = getPermissionErrorMessage(errors_1.ConfigErrorMessages.GetConfigError(constants_1.ConfigKeys.objectId, constants_1.Plugins.pluginName)[1], this.isGrantPermission);
|
|
561
|
-
throw results_1.ResultFactory.SystemError(errors_1.GetConfigError.name, [msg, msg1]);
|
|
562
|
-
}
|
|
563
|
-
}
|
|
564
|
-
}
|
|
565
|
-
exports.CheckGrantPermissionConfig = CheckGrantPermissionConfig;
|
|
566
7
|
function getPermissionErrorMessage(message, isGrantPermission = false, objectId) {
|
|
567
8
|
return isGrantPermission
|
|
568
9
|
? `${constants_1.Constants.permissions.name}: ${objectId}. Error: ${message}`
|