@microsoft/teamsfx-core 2.0.4-alpha.a99162fe0.0 → 2.0.4-alpha.ceeb9e1b9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/common/constants.d.ts +1 -0
- package/build/common/constants.d.ts.map +1 -1
- package/build/common/constants.js +1 -0
- package/build/common/constants.js.map +1 -1
- package/build/common/deps-checker/checkerFactory.d.ts +1 -2
- package/build/common/deps-checker/checkerFactory.d.ts.map +1 -1
- package/build/common/deps-checker/checkerFactory.js +2 -2
- package/build/common/deps-checker/checkerFactory.js.map +1 -1
- package/build/common/deps-checker/depsLogger.d.ts +14 -14
- package/build/common/deps-checker/depsLogger.d.ts.map +1 -1
- package/build/common/deps-checker/depsLogger.js +7 -21
- package/build/common/deps-checker/depsLogger.js.map +1 -1
- package/build/common/deps-checker/internal/dotnetChecker.d.ts.map +1 -1
- package/build/common/deps-checker/internal/dotnetChecker.js +40 -35
- package/build/common/deps-checker/internal/dotnetChecker.js.map +1 -1
- package/build/common/deps-checker/internal/nodeChecker.js +3 -3
- package/build/common/deps-checker/internal/nodeChecker.js.map +1 -1
- package/build/common/deps-checker/util/cpUtils.d.ts +1 -1
- package/build/common/deps-checker/util/cpUtils.d.ts.map +1 -1
- package/build/common/deps-checker/util/cpUtils.js +4 -4
- package/build/common/deps-checker/util/cpUtils.js.map +1 -1
- package/build/common/deps-checker/util/progressIndicator.js +2 -2
- package/build/common/deps-checker/util/progressIndicator.js.map +1 -1
- package/build/common/local/localCertificateManager.d.ts.map +1 -1
- package/build/common/local/localCertificateManager.js +3 -0
- package/build/common/local/localCertificateManager.js.map +1 -1
- package/build/common/local/packageJsonHelper.d.ts.map +1 -1
- package/build/common/local/packageJsonHelper.js +1 -0
- package/build/common/local/packageJsonHelper.js.map +1 -1
- package/build/common/local/portChecker.js.map +1 -1
- package/build/common/m365/launchHelper.d.ts +1 -1
- package/build/common/m365/launchHelper.d.ts.map +1 -1
- package/build/common/m365/launchHelper.js +20 -2
- 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 +52 -13
- package/build/common/m365/packageService.js.map +1 -1
- package/build/common/projectSettingsHelper.d.ts.map +1 -1
- package/build/common/projectSettingsHelper.js +1 -0
- package/build/common/projectSettingsHelper.js.map +1 -1
- package/build/common/samples.d.ts +4 -1
- package/build/common/samples.d.ts.map +1 -1
- package/build/common/samples.js +48 -21
- package/build/common/samples.js.map +1 -1
- package/build/common/spec-parser/adaptiveCardGenerator.d.ts.map +1 -1
- package/build/common/spec-parser/adaptiveCardGenerator.js +4 -4
- package/build/common/spec-parser/adaptiveCardGenerator.js.map +1 -1
- package/build/common/spec-parser/constants.d.ts +4 -0
- package/build/common/spec-parser/constants.d.ts.map +1 -1
- package/build/common/spec-parser/constants.js +27 -0
- package/build/common/spec-parser/constants.js.map +1 -1
- package/build/common/spec-parser/interfaces.d.ts +11 -5
- package/build/common/spec-parser/interfaces.d.ts.map +1 -1
- package/build/common/spec-parser/interfaces.js +4 -1
- package/build/common/spec-parser/interfaces.js.map +1 -1
- package/build/common/spec-parser/manifestUpdater.d.ts +3 -2
- package/build/common/spec-parser/manifestUpdater.d.ts.map +1 -1
- package/build/common/spec-parser/manifestUpdater.js +69 -31
- package/build/common/spec-parser/manifestUpdater.js.map +1 -1
- package/build/common/spec-parser/specFilter.d.ts +1 -1
- package/build/common/spec-parser/specFilter.d.ts.map +1 -1
- package/build/common/spec-parser/specFilter.js +5 -19
- package/build/common/spec-parser/specFilter.js.map +1 -1
- package/build/common/spec-parser/specParser.d.ts +7 -2
- package/build/common/spec-parser/specParser.d.ts.map +1 -1
- package/build/common/spec-parser/specParser.js +57 -25
- package/build/common/spec-parser/specParser.js.map +1 -1
- package/build/common/spec-parser/utils.d.ts +21 -0
- package/build/common/spec-parser/utils.d.ts.map +1 -1
- package/build/common/spec-parser/utils.js +182 -19
- package/build/common/spec-parser/utils.js.map +1 -1
- package/build/common/telemetry.d.ts +7 -4
- package/build/common/telemetry.d.ts.map +1 -1
- package/build/common/telemetry.js +42 -8
- package/build/common/telemetry.js.map +1 -1
- package/build/component/configManager/interface.d.ts +0 -1
- package/build/component/configManager/interface.d.ts.map +1 -1
- package/build/component/configManager/lifecycle.d.ts +1 -3
- package/build/component/configManager/lifecycle.d.ts.map +1 -1
- package/build/component/configManager/lifecycle.js +20 -49
- package/build/component/configManager/lifecycle.js.map +1 -1
- package/build/component/configManager/parser.js.map +1 -1
- package/build/component/configManager/validator.js +1 -1
- package/build/component/configManager/validator.js.map +1 -1
- package/build/component/constants.d.ts +5 -0
- package/build/component/constants.d.ts.map +1 -1
- package/build/component/constants.js +6 -1
- package/build/component/constants.js.map +1 -1
- package/build/component/coordinator/index.d.ts +6 -5
- package/build/component/coordinator/index.d.ts.map +1 -1
- package/build/component/coordinator/index.js +54 -55
- package/build/component/coordinator/index.js.map +1 -1
- package/build/component/coordinator/summary.d.ts.map +1 -1
- package/build/component/coordinator/summary.js +2 -1
- package/build/component/coordinator/summary.js.map +1 -1
- package/build/component/developerPortalScaffoldUtils.js +3 -3
- package/build/component/developerPortalScaffoldUtils.js.map +1 -1
- package/build/component/driver/aad/create.d.ts +1 -0
- package/build/component/driver/aad/create.d.ts.map +1 -1
- package/build/component/driver/aad/create.js +2 -5
- package/build/component/driver/aad/create.js.map +1 -1
- package/build/component/driver/aad/update.d.ts +1 -0
- package/build/component/driver/aad/update.d.ts.map +1 -1
- package/build/component/driver/aad/update.js +2 -5
- package/build/component/driver/aad/update.js.map +1 -1
- package/build/component/driver/aad/utility/aadAppClient.d.ts +1 -1
- package/build/component/driver/aad/utility/aadAppClient.d.ts.map +1 -1
- package/build/component/driver/aad/utility/aadAppClient.js +37 -4
- package/build/component/driver/aad/utility/aadAppClient.js.map +1 -1
- package/build/component/driver/add/addWebPart.d.ts.map +1 -1
- package/build/component/driver/add/addWebPart.js +9 -0
- package/build/component/driver/add/addWebPart.js.map +1 -1
- package/build/component/driver/arm/deploy.d.ts +1 -3
- package/build/component/driver/arm/deploy.d.ts.map +1 -1
- package/build/component/driver/arm/deploy.js +1 -14
- package/build/component/driver/arm/deploy.js.map +1 -1
- package/build/component/driver/arm/deployImpl.d.ts.map +1 -1
- package/build/component/driver/arm/deployImpl.js +8 -0
- package/build/component/driver/arm/deployImpl.js.map +1 -1
- package/build/component/driver/arm/util/bicepChecker.js +7 -6
- package/build/component/driver/arm/util/bicepChecker.js.map +1 -1
- package/build/component/driver/arm/util/handleError.js.map +1 -1
- package/build/component/driver/botAadApp/create.d.ts +1 -0
- package/build/component/driver/botAadApp/create.d.ts.map +1 -1
- package/build/component/driver/botAadApp/create.js +2 -5
- package/build/component/driver/botAadApp/create.js.map +1 -1
- package/build/component/driver/botFramework/createOrUpdateBot.d.ts +1 -0
- package/build/component/driver/botFramework/createOrUpdateBot.d.ts.map +1 -1
- package/build/component/driver/botFramework/createOrUpdateBot.js +4 -10
- package/build/component/driver/botFramework/createOrUpdateBot.js.map +1 -1
- package/build/component/driver/deploy/azure/azureAppServiceDeployDriver.d.ts +0 -2
- package/build/component/driver/deploy/azure/azureAppServiceDeployDriver.d.ts.map +1 -1
- package/build/component/driver/deploy/azure/azureAppServiceDeployDriver.js +0 -10
- package/build/component/driver/deploy/azure/azureAppServiceDeployDriver.js.map +1 -1
- package/build/component/driver/deploy/azure/azureFunctionDeployDriver.d.ts +0 -2
- package/build/component/driver/deploy/azure/azureFunctionDeployDriver.d.ts.map +1 -1
- package/build/component/driver/deploy/azure/azureFunctionDeployDriver.js +0 -10
- package/build/component/driver/deploy/azure/azureFunctionDeployDriver.js.map +1 -1
- package/build/component/driver/deploy/azure/azureStorageDeployDriver.d.ts +0 -2
- package/build/component/driver/deploy/azure/azureStorageDeployDriver.d.ts.map +1 -1
- package/build/component/driver/deploy/azure/azureStorageDeployDriver.js +17 -19
- package/build/component/driver/deploy/azure/azureStorageDeployDriver.js.map +1 -1
- package/build/component/driver/deploy/azure/azureStorageStaticWebsiteConfigDriver.d.ts.map +1 -1
- package/build/component/driver/deploy/azure/azureStorageStaticWebsiteConfigDriver.js +10 -3
- package/build/component/driver/deploy/azure/azureStorageStaticWebsiteConfigDriver.js.map +1 -1
- package/build/component/driver/deploy/azure/impl/AzureZipDeployImpl.d.ts.map +1 -1
- package/build/component/driver/deploy/azure/impl/AzureZipDeployImpl.js +29 -16
- package/build/component/driver/deploy/azure/impl/AzureZipDeployImpl.js.map +1 -1
- package/build/component/driver/deploy/azure/impl/azureDeployImpl.d.ts.map +1 -1
- package/build/component/driver/deploy/azure/impl/azureDeployImpl.js +18 -15
- package/build/component/driver/deploy/azure/impl/azureDeployImpl.js.map +1 -1
- package/build/component/driver/deploy/azure/impl/baseDeployImpl.d.ts.map +1 -1
- package/build/component/driver/deploy/azure/impl/baseDeployImpl.js +4 -4
- package/build/component/driver/deploy/azure/impl/baseDeployImpl.js.map +1 -1
- package/build/component/driver/deploy/spfx/deployDriver.d.ts +1 -0
- package/build/component/driver/deploy/spfx/deployDriver.d.ts.map +1 -1
- package/build/component/driver/deploy/spfx/deployDriver.js +24 -2
- package/build/component/driver/deploy/spfx/deployDriver.js.map +1 -1
- package/build/component/driver/devTool/installDriver.d.ts +1 -0
- package/build/component/driver/devTool/installDriver.d.ts.map +1 -1
- package/build/component/driver/devTool/installDriver.js +34 -12
- package/build/component/driver/devTool/installDriver.js.map +1 -1
- package/build/component/driver/file/createOrUpdateEnvironmentFile.d.ts +1 -0
- package/build/component/driver/file/createOrUpdateEnvironmentFile.d.ts.map +1 -1
- package/build/component/driver/file/createOrUpdateEnvironmentFile.js +10 -16
- package/build/component/driver/file/createOrUpdateEnvironmentFile.js.map +1 -1
- package/build/component/driver/file/createOrUpdateJsonFile.d.ts +1 -0
- package/build/component/driver/file/createOrUpdateJsonFile.d.ts.map +1 -1
- package/build/component/driver/file/createOrUpdateJsonFile.js +3 -9
- package/build/component/driver/file/createOrUpdateJsonFile.js.map +1 -1
- package/build/component/driver/interface/stepDriver.d.ts +2 -7
- package/build/component/driver/interface/stepDriver.d.ts.map +1 -1
- package/build/component/driver/m365/acquire.d.ts +1 -0
- package/build/component/driver/m365/acquire.d.ts.map +1 -1
- package/build/component/driver/m365/acquire.js +4 -10
- package/build/component/driver/m365/acquire.js.map +1 -1
- package/build/component/driver/script/baseBuildDriver.d.ts.map +1 -1
- package/build/component/driver/script/baseBuildDriver.js +1 -0
- package/build/component/driver/script/baseBuildDriver.js.map +1 -1
- package/build/component/driver/script/baseBuildStepDriver.d.ts +0 -2
- package/build/component/driver/script/baseBuildStepDriver.d.ts.map +1 -1
- package/build/component/driver/script/baseBuildStepDriver.js +0 -4
- package/build/component/driver/script/baseBuildStepDriver.js.map +1 -1
- package/build/component/driver/script/dotnetBuildDriver.d.ts +0 -2
- package/build/component/driver/script/dotnetBuildDriver.d.ts.map +1 -1
- package/build/component/driver/script/dotnetBuildDriver.js +0 -9
- package/build/component/driver/script/dotnetBuildDriver.js.map +1 -1
- package/build/component/driver/script/npmBuildDriver.d.ts +0 -2
- package/build/component/driver/script/npmBuildDriver.d.ts.map +1 -1
- package/build/component/driver/script/npmBuildDriver.js +0 -9
- package/build/component/driver/script/npmBuildDriver.js.map +1 -1
- package/build/component/driver/script/npxBuildDriver.d.ts +0 -2
- package/build/component/driver/script/npxBuildDriver.d.ts.map +1 -1
- package/build/component/driver/script/npxBuildDriver.js +0 -9
- package/build/component/driver/script/npxBuildDriver.js.map +1 -1
- package/build/component/driver/script/scriptDriver.d.ts +10 -1
- package/build/component/driver/script/scriptDriver.d.ts.map +1 -1
- package/build/component/driver/script/scriptDriver.js +31 -30
- package/build/component/driver/script/scriptDriver.js.map +1 -1
- package/build/component/driver/teamsApp/appStudio.d.ts.map +1 -1
- package/build/component/driver/teamsApp/appStudio.js +8 -8
- package/build/component/driver/teamsApp/appStudio.js.map +1 -1
- package/build/component/driver/teamsApp/clients/appStudioClient.d.ts +5 -5
- package/build/component/driver/teamsApp/clients/appStudioClient.d.ts.map +1 -1
- package/build/component/driver/teamsApp/clients/appStudioClient.js +31 -11
- package/build/component/driver/teamsApp/clients/appStudioClient.js.map +1 -1
- package/build/component/driver/teamsApp/clients/authSvcClient.d.ts.map +1 -1
- package/build/component/driver/teamsApp/clients/authSvcClient.js +2 -0
- package/build/component/driver/teamsApp/clients/authSvcClient.js.map +1 -1
- package/build/component/driver/teamsApp/configure.d.ts +1 -1
- package/build/component/driver/teamsApp/configure.d.ts.map +1 -1
- package/build/component/driver/teamsApp/configure.js +3 -11
- package/build/component/driver/teamsApp/configure.js.map +1 -1
- package/build/component/driver/teamsApp/copyAppPackageToSPFx.d.ts +1 -2
- package/build/component/driver/teamsApp/copyAppPackageToSPFx.d.ts.map +1 -1
- package/build/component/driver/teamsApp/copyAppPackageToSPFx.js +4 -11
- package/build/component/driver/teamsApp/copyAppPackageToSPFx.js.map +1 -1
- package/build/component/driver/teamsApp/create.d.ts +1 -1
- package/build/component/driver/teamsApp/create.d.ts.map +1 -1
- package/build/component/driver/teamsApp/create.js +6 -11
- package/build/component/driver/teamsApp/create.js.map +1 -1
- package/build/component/driver/teamsApp/createAppPackage.d.ts +3 -3
- package/build/component/driver/teamsApp/createAppPackage.d.ts.map +1 -1
- package/build/component/driver/teamsApp/createAppPackage.js +28 -40
- package/build/component/driver/teamsApp/createAppPackage.js.map +1 -1
- package/build/component/driver/teamsApp/errors.d.ts.map +1 -1
- package/build/component/driver/teamsApp/errors.js +2 -0
- package/build/component/driver/teamsApp/errors.js.map +1 -1
- package/build/component/driver/teamsApp/interfaces/appdefinitions/messagingExtension.d.ts +0 -1
- package/build/component/driver/teamsApp/interfaces/appdefinitions/messagingExtension.d.ts.map +1 -1
- package/build/component/driver/teamsApp/publishAppPackage.d.ts +1 -1
- package/build/component/driver/teamsApp/publishAppPackage.d.ts.map +1 -1
- package/build/component/driver/teamsApp/publishAppPackage.js +5 -13
- package/build/component/driver/teamsApp/publishAppPackage.js.map +1 -1
- package/build/component/driver/teamsApp/utils/ManifestUtils.d.ts.map +1 -1
- package/build/component/driver/teamsApp/utils/ManifestUtils.js +2 -0
- package/build/component/driver/teamsApp/utils/ManifestUtils.js.map +1 -1
- package/build/component/driver/teamsApp/utils/utils.d.ts +2 -2
- package/build/component/driver/teamsApp/utils/utils.d.ts.map +1 -1
- package/build/component/driver/teamsApp/utils/utils.js +21 -10
- package/build/component/driver/teamsApp/utils/utils.js.map +1 -1
- package/build/component/driver/teamsApp/validate.d.ts +1 -1
- package/build/component/driver/teamsApp/validate.d.ts.map +1 -1
- package/build/component/driver/teamsApp/validate.js +3 -11
- package/build/component/driver/teamsApp/validate.js.map +1 -1
- package/build/component/driver/teamsApp/validateAppPackage.d.ts +1 -1
- package/build/component/driver/teamsApp/validateAppPackage.d.ts.map +1 -1
- package/build/component/driver/teamsApp/validateAppPackage.js +3 -11
- package/build/component/driver/teamsApp/validateAppPackage.js.map +1 -1
- package/build/component/feature/collaboration.d.ts.map +1 -1
- package/build/component/feature/collaboration.js +28 -9
- package/build/component/feature/collaboration.js.map +1 -1
- package/build/component/generator/copilotPlugin/generator.d.ts +3 -1
- package/build/component/generator/copilotPlugin/generator.d.ts.map +1 -1
- package/build/component/generator/copilotPlugin/generator.js +42 -16
- package/build/component/generator/copilotPlugin/generator.js.map +1 -1
- package/build/component/generator/copilotPlugin/helper.d.ts +1 -1
- package/build/component/generator/copilotPlugin/helper.d.ts.map +1 -1
- package/build/component/generator/copilotPlugin/helper.js +23 -26
- package/build/component/generator/copilotPlugin/helper.js.map +1 -1
- package/build/component/generator/error.d.ts +6 -0
- package/build/component/generator/error.d.ts.map +1 -1
- package/build/component/generator/error.js +13 -1
- package/build/component/generator/error.js.map +1 -1
- package/build/component/generator/generator.d.ts.map +1 -1
- package/build/component/generator/generator.js +28 -19
- package/build/component/generator/generator.js.map +1 -1
- package/build/component/generator/generatorAction.d.ts +2 -1
- package/build/component/generator/generatorAction.d.ts.map +1 -1
- package/build/component/generator/generatorAction.js +8 -2
- package/build/component/generator/generatorAction.js.map +1 -1
- package/build/component/generator/officeAddin/generator.js +3 -3
- package/build/component/generator/officeAddin/generator.js.map +1 -1
- package/build/component/generator/officeAddin/helperMethods.d.ts.map +1 -1
- package/build/component/generator/officeAddin/helperMethods.js +6 -2
- package/build/component/generator/officeAddin/helperMethods.js.map +1 -1
- package/build/component/generator/spfx/depsChecker/generatorChecker.d.ts.map +1 -1
- package/build/component/generator/spfx/depsChecker/generatorChecker.js +4 -2
- package/build/component/generator/spfx/depsChecker/generatorChecker.js.map +1 -1
- package/build/component/generator/spfx/depsChecker/yoChecker.d.ts.map +1 -1
- package/build/component/generator/spfx/depsChecker/yoChecker.js +3 -3
- package/build/component/generator/spfx/depsChecker/yoChecker.js.map +1 -1
- package/build/component/generator/spfx/spfxGenerator.d.ts.map +1 -1
- package/build/component/generator/spfx/spfxGenerator.js +2 -2
- package/build/component/generator/spfx/spfxGenerator.js.map +1 -1
- package/build/component/generator/spfx/utils/utils.js +3 -3
- package/build/component/generator/spfx/utils/utils.js.map +1 -1
- package/build/component/generator/utils.d.ts +2 -2
- package/build/component/generator/utils.d.ts.map +1 -1
- package/build/component/generator/utils.js +13 -13
- package/build/component/generator/utils.js.map +1 -1
- package/build/component/messages.d.ts +2 -3
- package/build/component/messages.d.ts.map +1 -1
- package/build/component/messages.js +3 -4
- package/build/component/messages.js.map +1 -1
- package/build/component/middleware/actionExecutionMW.d.ts +2 -2
- package/build/component/middleware/actionExecutionMW.d.ts.map +1 -1
- package/build/component/middleware/envMW.js +1 -1
- package/build/component/middleware/envMW.js.map +1 -1
- package/build/component/provisionUtils.d.ts +3 -3
- package/build/component/provisionUtils.d.ts.map +1 -1
- package/build/component/provisionUtils.js +3 -3
- package/build/component/provisionUtils.js.map +1 -1
- package/build/component/resource/botService/appStudio/appStudioClient.d.ts.map +1 -1
- package/build/component/resource/botService/appStudio/appStudioClient.js +24 -2
- package/build/component/resource/botService/appStudio/appStudioClient.js.map +1 -1
- package/build/component/resource/botService/botRegistration/botFrameworkRegistration.d.ts +2 -2
- package/build/component/resource/botService/botRegistration/botFrameworkRegistration.d.ts.map +1 -1
- package/build/component/resource/botService/botRegistration/botFrameworkRegistration.js +6 -1
- package/build/component/resource/botService/botRegistration/botFrameworkRegistration.js.map +1 -1
- package/build/component/telemetry.js +2 -2
- package/build/component/telemetry.js.map +1 -1
- package/build/component/utils/ResourceGroupHelper.d.ts +2 -2
- package/build/component/utils/ResourceGroupHelper.d.ts.map +1 -1
- package/build/component/utils/ResourceGroupHelper.js +1 -4
- package/build/component/utils/ResourceGroupHelper.js.map +1 -1
- package/build/component/utils/charsetUtils.js +3 -3
- package/build/component/utils/charsetUtils.js.map +1 -1
- package/build/component/utils/common.js +1 -1
- package/build/component/utils/common.js.map +1 -1
- package/build/component/utils/depsChecker/cpUtils.d.ts.map +1 -1
- package/build/component/utils/depsChecker/cpUtils.js +8 -4
- package/build/component/utils/depsChecker/cpUtils.js.map +1 -1
- package/build/component/utils/envUtil.js +2 -2
- package/build/component/utils/envUtil.js.map +1 -1
- package/build/component/utils/teamsFxTelemetryReporter.js +2 -2
- package/build/component/utils/teamsFxTelemetryReporter.js.map +1 -1
- package/build/core/FxCore.d.ts +15 -19
- package/build/core/FxCore.d.ts.map +1 -1
- package/build/core/FxCore.js +800 -60
- package/build/core/FxCore.js.map +1 -1
- package/build/core/globalVars.d.ts +16 -0
- package/build/core/globalVars.d.ts.map +1 -1
- package/build/core/globalVars.js +34 -1
- package/build/core/globalVars.js.map +1 -1
- package/build/core/middleware/concurrentLocker.d.ts.map +1 -1
- package/build/core/middleware/concurrentLocker.js +7 -3
- package/build/core/middleware/concurrentLocker.js.map +1 -1
- package/build/core/middleware/projectMigratorV3.d.ts.map +1 -1
- package/build/core/middleware/projectMigratorV3.js.map +1 -1
- package/build/core/middleware/projectVersionChecker.js +5 -5
- package/build/core/middleware/projectVersionChecker.js.map +1 -1
- package/build/core/middleware/utils/appYmlGenerator.d.ts.map +1 -1
- package/build/core/middleware/utils/appYmlGenerator.js +2 -1
- package/build/core/middleware/utils/appYmlGenerator.js.map +1 -1
- package/build/core/middleware/utils/debug/taskMigrator.d.ts.map +1 -1
- package/build/core/middleware/utils/debug/taskMigrator.js +3 -0
- package/build/core/middleware/utils/debug/taskMigrator.js.map +1 -1
- package/build/core/middleware/utils/v3MigrationUtils.js +1 -1
- package/build/core/middleware/utils/v3MigrationUtils.js.map +1 -1
- package/build/error/common.d.ts +0 -6
- package/build/error/common.d.ts.map +1 -1
- package/build/error/common.js +1 -29
- package/build/error/common.js.map +1 -1
- package/build/index.d.ts +2 -0
- package/build/index.d.ts.map +1 -1
- package/build/index.js +2 -0
- package/build/index.js.map +1 -1
- package/build/question/constants.d.ts +2 -2
- package/build/question/constants.d.ts.map +1 -1
- package/build/question/constants.js +2 -2
- package/build/question/constants.js.map +1 -1
- package/build/question/create.d.ts +4 -1
- package/build/question/create.d.ts.map +1 -1
- package/build/question/create.js +63 -36
- package/build/question/create.js.map +1 -1
- package/build/question/generator.d.ts.map +1 -1
- package/build/question/generator.js +11 -17
- package/build/question/generator.js.map +1 -1
- package/build/question/inputs/CreateProjectInputs.d.ts +4 -4
- package/build/question/inputs/CreateProjectInputs.d.ts.map +1 -1
- package/build/question/options/CreateProjectOptions.d.ts.map +1 -1
- package/build/question/options/CreateProjectOptions.js +16 -17
- package/build/question/options/CreateProjectOptions.js.map +1 -1
- package/build/question/options/DeployAadManifestOptions.js +1 -1
- package/build/question/options/DeployAadManifestOptions.js.map +1 -1
- package/build/question/options/PermissionGrantOptions.js +2 -2
- package/build/question/options/PermissionGrantOptions.js.map +1 -1
- package/build/question/options/PermissionListOptions.js +2 -2
- package/build/question/options/PermissionListOptions.js.map +1 -1
- package/build/question/options/PreviewTeamsAppOptions.js +2 -2
- package/build/question/options/PreviewTeamsAppOptions.js.map +1 -1
- package/build/question/options/SPFxAddWebpartOptions.d.ts.map +1 -1
- package/build/question/options/SPFxAddWebpartOptions.js +2 -3
- package/build/question/options/SPFxAddWebpartOptions.js.map +1 -1
- package/build/question/options/SelectTeamsManifestOptions.js +1 -1
- package/build/question/options/SelectTeamsManifestOptions.js.map +1 -1
- package/build/question/options/ValidateTeamsAppOptions.js +2 -2
- package/build/question/options/ValidateTeamsAppOptions.js.map +1 -1
- package/build/question/other.d.ts.map +1 -1
- package/build/question/other.js +7 -5
- package/build/question/other.js.map +1 -1
- package/build/question/questionNames.d.ts +5 -2
- package/build/question/questionNames.d.ts.map +1 -1
- package/build/question/questionNames.js +7 -3
- package/build/question/questionNames.js.map +1 -1
- package/build/ui/validationUtils.d.ts +17 -1
- package/build/ui/validationUtils.d.ts.map +1 -1
- package/build/ui/validationUtils.js +206 -17
- package/build/ui/validationUtils.js.map +1 -1
- package/build/ui/visitor.d.ts.map +1 -1
- package/build/ui/visitor.js +17 -17
- package/build/ui/visitor.js.map +1 -1
- package/package.json +13 -13
- package/resource/package.nls.json +10 -8
- 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/templates/plugins/resource/aad/auth/V3/Tab/GetUserProfile.razor +1 -2
- package/templates/plugins/resource/aad/auth/tab/csharp/GetUserProfile.razor +1 -2
- package/build/common/samples-config-v3.json +0 -446
- package/build/component/driver/middleware/updateProgress.d.ts +0 -6
- package/build/component/driver/middleware/updateProgress.d.ts.map +0 -1
- package/build/component/driver/middleware/updateProgress.js +0 -15
- package/build/component/driver/middleware/updateProgress.js.map +0 -1
- package/build/core/FxCoreImplementV3.d.ts +0 -51
- package/build/core/FxCoreImplementV3.d.ts.map +0 -1
- package/build/core/FxCoreImplementV3.js +0 -736
- package/build/core/FxCoreImplementV3.js.map +0 -1
|
@@ -50,7 +50,7 @@ class SpecParser {
|
|
|
50
50
|
errors,
|
|
51
51
|
};
|
|
52
52
|
}
|
|
53
|
-
//
|
|
53
|
+
// TODO: we will support swagger 2.0
|
|
54
54
|
if (!this.spec.openapi || this.spec.openapi < "3.0.0") {
|
|
55
55
|
errors.push({
|
|
56
56
|
type: interfaces_1.ErrorType.VersionNotSupported,
|
|
@@ -63,20 +63,9 @@ class SpecParser {
|
|
|
63
63
|
errors,
|
|
64
64
|
};
|
|
65
65
|
}
|
|
66
|
-
// Server
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
type: interfaces_1.ErrorType.NoServerInformation,
|
|
70
|
-
content: constants_1.ConstantString.NoServerInformation,
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
else if (this.spec.servers.length > 1) {
|
|
74
|
-
errors.push({
|
|
75
|
-
type: interfaces_1.ErrorType.MultipleServerInformation,
|
|
76
|
-
content: constants_1.ConstantString.MultipleServerInformation,
|
|
77
|
-
data: this.spec.servers,
|
|
78
|
-
});
|
|
79
|
-
}
|
|
66
|
+
// Server validation
|
|
67
|
+
const serverErrors = utils_1.validateServer(this.spec);
|
|
68
|
+
errors.push(...serverErrors);
|
|
80
69
|
// Remote reference not supported
|
|
81
70
|
const refPaths = this.parser.$refs.paths();
|
|
82
71
|
// refPaths [0] is the current spec file path
|
|
@@ -142,6 +131,31 @@ class SpecParser {
|
|
|
142
131
|
throw new specParserError_1.SpecParserError(err.toString(), interfaces_1.ErrorType.ListFailed);
|
|
143
132
|
}
|
|
144
133
|
}
|
|
134
|
+
/**
|
|
135
|
+
* List all the OpenAPI operations in the specification file and return a map of operationId and operation path.
|
|
136
|
+
* @returns A map of operationId and operation path, such as [{'getPetById': 'GET /pets/{petId}'}, {'getUser': 'GET /user/{userId}'}]
|
|
137
|
+
*/
|
|
138
|
+
async listOperationMap() {
|
|
139
|
+
try {
|
|
140
|
+
await this.loadSpec();
|
|
141
|
+
const apiMap = this.getAllSupportedApi(this.spec);
|
|
142
|
+
const operationMap = new Map();
|
|
143
|
+
for (const key in apiMap) {
|
|
144
|
+
const pathObjectItem = apiMap[key];
|
|
145
|
+
let operationId = pathObjectItem.operationId;
|
|
146
|
+
if (!operationId) {
|
|
147
|
+
const [method, path] = key.split(" ");
|
|
148
|
+
const methodName = method.toLowerCase();
|
|
149
|
+
operationId = `${methodName}${utils_1.convertPathToCamelCase(path)}`;
|
|
150
|
+
}
|
|
151
|
+
operationMap.set(operationId, key);
|
|
152
|
+
}
|
|
153
|
+
return operationMap;
|
|
154
|
+
}
|
|
155
|
+
catch (err) {
|
|
156
|
+
throw new specParserError_1.SpecParserError(err.toString(), interfaces_1.ErrorType.ListOperationMapFailed);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
145
159
|
/**
|
|
146
160
|
* Generates and update artifacts from the OpenAPI specification file. Generate Adaptive Cards, update Teams app manifest, and generate a new OpenAPI specification file.
|
|
147
161
|
* @param manifestPath A file path of the Teams app manifest file to update.
|
|
@@ -150,7 +164,10 @@ class SpecParser {
|
|
|
150
164
|
* @param adaptiveCardFolder Folder path where the Adaptive Card files will be generated. If not specified or empty, Adaptive Card files will not be generated.
|
|
151
165
|
*/
|
|
152
166
|
async generate(manifestPath, filter, outputSpecPath, adaptiveCardFolder, signal) {
|
|
153
|
-
|
|
167
|
+
const result = {
|
|
168
|
+
allSuccess: true,
|
|
169
|
+
warnings: [],
|
|
170
|
+
};
|
|
154
171
|
try {
|
|
155
172
|
if (signal === null || signal === void 0 ? void 0 : signal.aborted) {
|
|
156
173
|
throw new specParserError_1.SpecParserError(constants_1.ConstantString.CancelledMessage, interfaces_1.ErrorType.Cancelled);
|
|
@@ -159,7 +176,7 @@ class SpecParser {
|
|
|
159
176
|
if (signal === null || signal === void 0 ? void 0 : signal.aborted) {
|
|
160
177
|
throw new specParserError_1.SpecParserError(constants_1.ConstantString.CancelledMessage, interfaces_1.ErrorType.Cancelled);
|
|
161
178
|
}
|
|
162
|
-
const newUnResolvedSpec = specFilter_1.specFilter(filter, this.unResolveSpec);
|
|
179
|
+
const newUnResolvedSpec = specFilter_1.specFilter(filter, this.unResolveSpec, this.spec);
|
|
163
180
|
let resultStr;
|
|
164
181
|
if (outputSpecPath.endsWith(".yaml") || outputSpecPath.endsWith(".yml")) {
|
|
165
182
|
resultStr = js_yaml_1.default.dump(newUnResolvedSpec);
|
|
@@ -172,17 +189,31 @@ class SpecParser {
|
|
|
172
189
|
throw new specParserError_1.SpecParserError(constants_1.ConstantString.CancelledMessage, interfaces_1.ErrorType.Cancelled);
|
|
173
190
|
}
|
|
174
191
|
const newSpec = (await this.parser.dereference(newUnResolvedSpec));
|
|
175
|
-
|
|
176
|
-
|
|
192
|
+
for (const url in newSpec.paths) {
|
|
193
|
+
for (const method in newSpec.paths[url]) {
|
|
194
|
+
if (method === constants_1.ConstantString.GetMethod || method === constants_1.ConstantString.PostMethod) {
|
|
195
|
+
const operation = newSpec.paths[url][method];
|
|
196
|
+
try {
|
|
197
|
+
const card = adaptiveCardGenerator_1.generateAdaptiveCard(operation);
|
|
198
|
+
const fileName = path_1.default.join(adaptiveCardFolder, `${operation.operationId}.json`);
|
|
199
|
+
await fs_extra_1.default.outputJSON(fileName, card, { spaces: 2 });
|
|
200
|
+
}
|
|
201
|
+
catch (err) {
|
|
202
|
+
result.allSuccess = false;
|
|
203
|
+
result.warnings.push({
|
|
204
|
+
type: interfaces_1.WarningType.GenerateCardFailed,
|
|
205
|
+
content: err.toString(),
|
|
206
|
+
data: operation.operationId,
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
177
212
|
if (signal === null || signal === void 0 ? void 0 : signal.aborted) {
|
|
178
213
|
throw new specParserError_1.SpecParserError(constants_1.ConstantString.CancelledMessage, interfaces_1.ErrorType.Cancelled);
|
|
179
214
|
}
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
const card = adaptiveCardGenerator_1.generateAdaptiveCard(getOperation);
|
|
183
|
-
const fileName = path_1.default.join(adaptiveCardFolder, `${getOperation.operationId}.json`);
|
|
184
|
-
await fs_extra_1.default.outputJSON(fileName, card, { spaces: 2 });
|
|
185
|
-
}
|
|
215
|
+
const updatedManifest = await manifestUpdater_1.updateManifest(manifestPath, outputSpecPath, adaptiveCardFolder, newSpec);
|
|
216
|
+
await fs_extra_1.default.outputJSON(manifestPath, updatedManifest, { spaces: 2 });
|
|
186
217
|
}
|
|
187
218
|
catch (err) {
|
|
188
219
|
if (err instanceof specParserError_1.SpecParserError) {
|
|
@@ -190,6 +221,7 @@ class SpecParser {
|
|
|
190
221
|
}
|
|
191
222
|
throw new specParserError_1.SpecParserError(err.toString(), interfaces_1.ErrorType.GenerateFailed);
|
|
192
223
|
}
|
|
224
|
+
return result;
|
|
193
225
|
}
|
|
194
226
|
async loadSpec() {
|
|
195
227
|
if (!this.spec) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"specParser.js","sourceRoot":"","sources":["../../../src/common/spec-parser/specParser.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,YAAY,CAAC;;;;AAEb,mDAA6B;AAC7B,yFAAwD;AAExD,uDAAoD;AACpD,
|
|
1
|
+
{"version":3,"file":"specParser.js","sourceRoot":"","sources":["../../../src/common/spec-parser/specParser.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,YAAY,CAAC;;;;AAEb,mDAA6B;AAC7B,yFAAwD;AAExD,uDAAoD;AACpD,6CASsB;AACtB,2CAA6C;AAC7C,8DAA6B;AAC7B,gEAA0B;AAC1B,6CAA0C;AAC1C,mCAAiF;AACjF,uDAAmD;AACnD,mEAA+D;AAC/D,wDAAwB;AAExB;;GAEG;AACH,MAAa,UAAU;IAQrB;;;OAGG;IACH,YAAY,IAAY;QACtB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,IAAI,wBAAa,EAAE,CAAC;IACpC,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,QAAQ;QACZ,IAAI;YACF,MAAM,MAAM,GAAkB,EAAE,CAAC;YACjC,MAAM,QAAQ,GAAoB,EAAE,CAAC;YACrC,IAAI;gBACF,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAC;gBACtB,MAAM,IAAI,CAAC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FAAuF;gBACvF,IAAI,sBAAc,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE;oBACtC,MAAM,eAAe,GAAI,OAAe,CAAC,MAAM,CAA8B,CAAC;oBAC9E,MAAM,CAAC,GAAG,MAAM,CAAC,WAAW,EAAE,IAAI,IAAI,EAAE,CAAC,GAAG,eAAe,CAAC;iBAC7D;aACF;SACF;QACD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AA7QD,gCA6QC"}
|
|
@@ -1,7 +1,28 @@
|
|
|
1
1
|
import { OpenAPIV3 } from "openapi-types";
|
|
2
|
+
import { ErrorResult } from "./interfaces";
|
|
2
3
|
export declare function isYamlSpecFile(specPath: string): Promise<boolean>;
|
|
4
|
+
export declare function checkRequiredParameters(paramObject: OpenAPIV3.ParameterObject[], limit?: number): boolean;
|
|
5
|
+
export declare function isSupportedSchema(schema: OpenAPIV3.SchemaObject): boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Checks if the given API is supported.
|
|
8
|
+
* @param {string} method - The HTTP method of the API.
|
|
9
|
+
* @param {string} path - The path of the API.
|
|
10
|
+
* @param {OpenAPIV3.Document} spec - The OpenAPI specification document.
|
|
11
|
+
* @returns {boolean} - Returns true if the API is supported, false otherwise.
|
|
12
|
+
* @description The following APIs are supported:
|
|
13
|
+
* 1. only support Get/Post operation without auth property
|
|
14
|
+
* 2. parameter inside query or path only support string, number, boolean and integer
|
|
15
|
+
* 3. parameter inside post body only support string, number, boolean, integer and object
|
|
16
|
+
* 4. request body + required parameters <= 1
|
|
17
|
+
* 5. response body should be “application/json” and not empty, and response code should be 20X
|
|
18
|
+
* 6. only support request body with “application/json” content type
|
|
19
|
+
*/
|
|
3
20
|
export declare function isSupportedApi(method: string, path: string, spec: OpenAPIV3.Document): boolean;
|
|
4
21
|
export declare function updateFirstLetter(str: string): string;
|
|
5
22
|
export declare function getRelativePath(from: string, to: string): string;
|
|
6
23
|
export declare function getResponseJson(operationObject: OpenAPIV3.OperationObject | undefined): OpenAPIV3.MediaTypeObject;
|
|
24
|
+
export declare function convertPathToCamelCase(path: string): string;
|
|
25
|
+
export declare function getUrlProtocol(urlString: string): string | undefined;
|
|
26
|
+
export declare function checkServerUrl(servers: OpenAPIV3.ServerObject[]): ErrorResult[];
|
|
27
|
+
export declare function validateServer(spec: OpenAPIV3.Document): ErrorResult[];
|
|
7
28
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/common/spec-parser/utils.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAG1C,wBAAsB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAiBvE;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,CAAC,QAAQ,GAAG,OAAO,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/common/spec-parser/utils.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAG1C,OAAO,EAAE,WAAW,EAAa,MAAM,cAAc,CAAC;AAEtD,wBAAsB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAiBvE;AAED,wBAAgB,uBAAuB,CACrC,WAAW,EAAE,SAAS,CAAC,eAAe,EAAE,EACxC,KAAK,SAAI,GACR,OAAO,CAgCT;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,CAAC,YAAY,GAAG,OAAO,CA2BzE;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,CAAC,QAAQ,GAAG,OAAO,CAsC9F;AAED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAErD;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAGhE;AAED,wBAAgB,eAAe,CAC7B,eAAe,EAAE,SAAS,CAAC,eAAe,GAAG,SAAS,GACrD,SAAS,CAAC,eAAe,CAY3B;AAED,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAU3D;AAED,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAOpE;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,SAAS,CAAC,YAAY,EAAE,GAAG,WAAW,EAAE,CAoB/E;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,SAAS,CAAC,QAAQ,GAAG,WAAW,EAAE,CA2CtE"}
|
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
// Licensed under the MIT license.
|
|
3
3
|
"use strict";
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.getResponseJson = exports.getRelativePath = exports.updateFirstLetter = exports.isSupportedApi = exports.isYamlSpecFile = void 0;
|
|
5
|
+
exports.validateServer = exports.checkServerUrl = exports.getUrlProtocol = exports.convertPathToCamelCase = exports.getResponseJson = exports.getRelativePath = exports.updateFirstLetter = exports.isSupportedApi = exports.isSupportedSchema = exports.checkRequiredParameters = exports.isYamlSpecFile = void 0;
|
|
6
6
|
const tslib_1 = require("tslib");
|
|
7
7
|
const axios_1 = tslib_1.__importDefault(require("axios"));
|
|
8
8
|
const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
|
|
9
9
|
const constants_1 = require("./constants");
|
|
10
10
|
const path_1 = tslib_1.__importDefault(require("path"));
|
|
11
|
+
const util = tslib_1.__importStar(require("util"));
|
|
12
|
+
const interfaces_1 = require("./interfaces");
|
|
11
13
|
async function isYamlSpecFile(specPath) {
|
|
12
14
|
if (specPath.endsWith(".yaml") || specPath.endsWith(".yml")) {
|
|
13
15
|
return true;
|
|
@@ -28,30 +30,104 @@ async function isYamlSpecFile(specPath) {
|
|
|
28
30
|
}
|
|
29
31
|
}
|
|
30
32
|
exports.isYamlSpecFile = isYamlSpecFile;
|
|
33
|
+
function checkRequiredParameters(paramObject, limit = 1) {
|
|
34
|
+
if (limit === 0 && !paramObject) {
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
let requiredParamCount = 0;
|
|
38
|
+
for (let i = 0; i < paramObject.length; i++) {
|
|
39
|
+
const param = paramObject[i];
|
|
40
|
+
if (param.in === "header" || param.in === "cookie") {
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
const schema = param.schema;
|
|
44
|
+
if (schema.type !== "boolean" &&
|
|
45
|
+
schema.type !== "string" &&
|
|
46
|
+
schema.type !== "number" &&
|
|
47
|
+
schema.type !== "integer") {
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
if (param.required && (param.in === "query" || param.in === "path")) {
|
|
51
|
+
requiredParamCount++;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
if (requiredParamCount <= limit) {
|
|
55
|
+
return true;
|
|
56
|
+
}
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
exports.checkRequiredParameters = checkRequiredParameters;
|
|
60
|
+
function isSupportedSchema(schema) {
|
|
61
|
+
// we support schema: {}
|
|
62
|
+
if (Object.keys(schema).length === 0) {
|
|
63
|
+
return true;
|
|
64
|
+
}
|
|
65
|
+
if (schema.type === "string" ||
|
|
66
|
+
schema.type === "integer" ||
|
|
67
|
+
schema.type === "boolean" ||
|
|
68
|
+
schema.type === "number") {
|
|
69
|
+
return true;
|
|
70
|
+
}
|
|
71
|
+
else if (schema.type === "array") {
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
else if (schema.type === "object") {
|
|
75
|
+
const { properties } = schema;
|
|
76
|
+
for (const property in properties) {
|
|
77
|
+
const result = isSupportedSchema(properties[property]);
|
|
78
|
+
if (!result) {
|
|
79
|
+
return false;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return true;
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
return false;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
exports.isSupportedSchema = isSupportedSchema;
|
|
89
|
+
/**
|
|
90
|
+
* Checks if the given API is supported.
|
|
91
|
+
* @param {string} method - The HTTP method of the API.
|
|
92
|
+
* @param {string} path - The path of the API.
|
|
93
|
+
* @param {OpenAPIV3.Document} spec - The OpenAPI specification document.
|
|
94
|
+
* @returns {boolean} - Returns true if the API is supported, false otherwise.
|
|
95
|
+
* @description The following APIs are supported:
|
|
96
|
+
* 1. only support Get/Post operation without auth property
|
|
97
|
+
* 2. parameter inside query or path only support string, number, boolean and integer
|
|
98
|
+
* 3. parameter inside post body only support string, number, boolean, integer and object
|
|
99
|
+
* 4. request body + required parameters <= 1
|
|
100
|
+
* 5. response body should be “application/json” and not empty, and response code should be 20X
|
|
101
|
+
* 6. only support request body with “application/json” content type
|
|
102
|
+
*/
|
|
31
103
|
function isSupportedApi(method, path, spec) {
|
|
32
104
|
var _a;
|
|
33
105
|
const pathObj = spec.paths[path];
|
|
34
106
|
method = method.toLocaleLowerCase();
|
|
35
107
|
if (pathObj) {
|
|
36
|
-
if (method === constants_1.ConstantString.
|
|
108
|
+
if ((method === constants_1.ConstantString.PostMethod || method === constants_1.ConstantString.GetMethod) &&
|
|
109
|
+
pathObj[method] &&
|
|
110
|
+
!((_a = pathObj[method]) === null || _a === void 0 ? void 0 : _a.security)) {
|
|
37
111
|
const operationObject = pathObj[method];
|
|
38
112
|
const paramObject = operationObject.parameters;
|
|
39
|
-
|
|
113
|
+
const requestBody = operationObject.requestBody;
|
|
114
|
+
const requestJsonBody = requestBody === null || requestBody === void 0 ? void 0 : requestBody.content["application/json"];
|
|
115
|
+
const parameterLimit = requestJsonBody ? 0 : 1;
|
|
116
|
+
const responseJson = getResponseJson(operationObject);
|
|
117
|
+
if (Object.keys(responseJson).length === 0) {
|
|
118
|
+
return false;
|
|
119
|
+
}
|
|
120
|
+
if ((!paramObject || paramObject.length === 0) && !requestBody) {
|
|
40
121
|
return true;
|
|
41
122
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
schema.type === "integer" ||
|
|
49
|
-
schema.type === "number" ||
|
|
50
|
-
schema.type === "string") {
|
|
51
|
-
return true;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
123
|
+
const valid = checkRequiredParameters(paramObject, parameterLimit);
|
|
124
|
+
if (valid) {
|
|
125
|
+
if (requestBody) {
|
|
126
|
+
const schema = requestJsonBody.schema;
|
|
127
|
+
const requestJsonBodySupported = isSupportedSchema(schema);
|
|
128
|
+
return requestJsonBodySupported;
|
|
54
129
|
}
|
|
130
|
+
return true;
|
|
55
131
|
}
|
|
56
132
|
}
|
|
57
133
|
}
|
|
@@ -68,12 +144,99 @@ function getRelativePath(from, to) {
|
|
|
68
144
|
}
|
|
69
145
|
exports.getRelativePath = getRelativePath;
|
|
70
146
|
function getResponseJson(operationObject) {
|
|
71
|
-
var _a, _b
|
|
72
|
-
let json =
|
|
73
|
-
|
|
74
|
-
|
|
147
|
+
var _a, _b;
|
|
148
|
+
let json = {};
|
|
149
|
+
for (const code of constants_1.ConstantString.ResponseCodeFor20X) {
|
|
150
|
+
const responseObject = (_a = operationObject === null || operationObject === void 0 ? void 0 : operationObject.responses) === null || _a === void 0 ? void 0 : _a[code];
|
|
151
|
+
if ((_b = responseObject === null || responseObject === void 0 ? void 0 : responseObject.content) === null || _b === void 0 ? void 0 : _b["application/json"]) {
|
|
152
|
+
json = responseObject.content["application/json"];
|
|
153
|
+
break;
|
|
154
|
+
}
|
|
75
155
|
}
|
|
76
156
|
return json;
|
|
77
157
|
}
|
|
78
158
|
exports.getResponseJson = getResponseJson;
|
|
159
|
+
function convertPathToCamelCase(path) {
|
|
160
|
+
const pathSegments = path.split("/");
|
|
161
|
+
const camelCaseSegments = pathSegments.map((segment) => {
|
|
162
|
+
if (segment.startsWith("{")) {
|
|
163
|
+
segment = segment.substring(1, segment.length - 1);
|
|
164
|
+
}
|
|
165
|
+
return segment.charAt(0).toUpperCase() + segment.slice(1);
|
|
166
|
+
});
|
|
167
|
+
const camelCasePath = camelCaseSegments.join("");
|
|
168
|
+
return camelCasePath;
|
|
169
|
+
}
|
|
170
|
+
exports.convertPathToCamelCase = convertPathToCamelCase;
|
|
171
|
+
function getUrlProtocol(urlString) {
|
|
172
|
+
try {
|
|
173
|
+
const url = new URL(urlString);
|
|
174
|
+
return url.protocol;
|
|
175
|
+
}
|
|
176
|
+
catch (err) {
|
|
177
|
+
return undefined;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
exports.getUrlProtocol = getUrlProtocol;
|
|
181
|
+
function checkServerUrl(servers) {
|
|
182
|
+
const errors = [];
|
|
183
|
+
const protocol = getUrlProtocol(servers[0].url);
|
|
184
|
+
if (!protocol) {
|
|
185
|
+
// Relative server url is not supported
|
|
186
|
+
errors.push({
|
|
187
|
+
type: interfaces_1.ErrorType.RelativeServerUrlNotSupported,
|
|
188
|
+
content: constants_1.ConstantString.RelativeServerUrlNotSupported,
|
|
189
|
+
data: servers,
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
else if (protocol !== "https:") {
|
|
193
|
+
// Http server url is not supported
|
|
194
|
+
errors.push({
|
|
195
|
+
type: interfaces_1.ErrorType.UrlProtocolNotSupported,
|
|
196
|
+
content: util.format(constants_1.ConstantString.UrlProtocolNotSupported, protocol),
|
|
197
|
+
data: servers,
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
return errors;
|
|
201
|
+
}
|
|
202
|
+
exports.checkServerUrl = checkServerUrl;
|
|
203
|
+
function validateServer(spec) {
|
|
204
|
+
const errors = [];
|
|
205
|
+
let hasTopLevelServers = false;
|
|
206
|
+
let hasPathLevelServers = false;
|
|
207
|
+
let hasOperationLevelServers = false;
|
|
208
|
+
if (spec.servers && spec.servers.length >= 1) {
|
|
209
|
+
hasTopLevelServers = true;
|
|
210
|
+
// for multiple server, we only use the first url
|
|
211
|
+
const serverErrors = checkServerUrl(spec.servers);
|
|
212
|
+
errors.push(...serverErrors);
|
|
213
|
+
}
|
|
214
|
+
const paths = spec.paths;
|
|
215
|
+
for (const path in paths) {
|
|
216
|
+
const methods = paths[path];
|
|
217
|
+
if ((methods === null || methods === void 0 ? void 0 : methods.servers) && methods.servers.length >= 1) {
|
|
218
|
+
hasPathLevelServers = true;
|
|
219
|
+
const serverErrors = checkServerUrl(methods.servers);
|
|
220
|
+
errors.push(...serverErrors);
|
|
221
|
+
}
|
|
222
|
+
for (const method in methods) {
|
|
223
|
+
const operationObject = methods[method];
|
|
224
|
+
if (isSupportedApi(method, path, spec)) {
|
|
225
|
+
if ((operationObject === null || operationObject === void 0 ? void 0 : operationObject.servers) && operationObject.servers.length >= 1) {
|
|
226
|
+
hasOperationLevelServers = true;
|
|
227
|
+
const serverErrors = checkServerUrl(operationObject.servers);
|
|
228
|
+
errors.push(...serverErrors);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
if (!hasTopLevelServers && !hasPathLevelServers && !hasOperationLevelServers) {
|
|
234
|
+
errors.push({
|
|
235
|
+
type: interfaces_1.ErrorType.NoServerInformation,
|
|
236
|
+
content: constants_1.ConstantString.NoServerInformation,
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
return errors;
|
|
240
|
+
}
|
|
241
|
+
exports.validateServer = validateServer;
|
|
79
242
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/common/spec-parser/utils.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,k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AG,YAAY,CAAC,CAAC;SAC9B;QAED,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE;YAC5B,MAAM,eAAe,GAAI,OAAe,CAAC,MAAM,CAA8B,CAAC;YAC9E,IAAI,cAAc,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE;gBACtC,IAAI,CAAA,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,OAAO,KAAI,eAAe,CAAC,OAAO,CAAC,MAAM,IAAI,CAAC,EAAE;oBACnE,wBAAwB,GAAG,IAAI,CAAC;oBAChC,MAAM,YAAY,GAAG,cAAc,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;oBAC7D,MAAM,CAAC,IAAI,CAAC,GAAG,YAAY,CAAC,CAAC;iBAC9B;aACF;SACF;KACF;IACD,IAAI,CAAC,kBAAkB,IAAI,CAAC,mBAAmB,IAAI,CAAC,wBAAwB,EAAE;QAC5E,MAAM,CAAC,IAAI,CAAC;YACV,IAAI,EAAE,sBAAS,CAAC,mBAAmB;YACnC,OAAO,EAAE,0BAAc,CAAC,mBAAmB;SAC5C,CAAC,CAAC;KACJ;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AA3CD,wCA2CC"}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import { FxError
|
|
2
|
-
export declare class TelemetryReporterInstance {
|
|
3
|
-
static telemetryReporter: TelemetryReporter | undefined;
|
|
4
|
-
}
|
|
1
|
+
import { FxError } from "@microsoft/teamsfx-api";
|
|
5
2
|
export declare enum TelemetryProperty {
|
|
6
3
|
TriggerFrom = "trigger-from",
|
|
7
4
|
Component = "component",
|
|
@@ -156,4 +153,10 @@ export declare function sendTelemetryEvent(component: string, eventName: string,
|
|
|
156
153
|
export declare function sendTelemetryErrorEvent(component: string, eventName: string, fxError: FxError, properties?: {
|
|
157
154
|
[p: string]: string;
|
|
158
155
|
}): void;
|
|
156
|
+
/**
|
|
157
|
+
* fill in telemetry properties for FxError
|
|
158
|
+
* @param error FxError
|
|
159
|
+
* @param props teletry properties
|
|
160
|
+
*/
|
|
161
|
+
export declare function fillInTelemetryPropsForFxError(props: Record<string, string>, error: FxError): void;
|
|
159
162
|
//# sourceMappingURL=telemetry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"telemetry.d.ts","sourceRoot":"","sources":["../../src/common/telemetry.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"telemetry.d.ts","sourceRoot":"","sources":["../../src/common/telemetry.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAe,MAAM,wBAAwB,CAAC;AAI9D,oBAAY,iBAAiB;IAC3B,WAAW,iBAAiB;IAC5B,SAAS,cAAc;IACvB,UAAU,eAAe;IACzB,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,KAAK,UAAU;IACf,OAAO,YAAY;IACnB,SAAS,eAAe;IACxB,SAAS,eAAe;IACxB,YAAY,kBAAkB;IAC9B,aAAa,oBAAoB;IACjC,SAAS,eAAe;IACxB,YAAY,mBAAmB;IAC/B,aAAa,mBAAmB;IAChC,GAAG,QAAQ;IACX,0BAA0B,kCAAkC;IAC5D,SAAS,eAAe;IACxB,MAAM,WAAW;IACjB,QAAQ,aAAa;IACrB,cAAc,oBAAoB;IAClC,YAAY,iBAAiB;IAC7B,aAAa,mBAAmB;IAChC,oBAAoB,2BAA2B;IAC/C,sBAAsB,8BAA8B;IACpD,0BAA0B,gBAAgB;IAC1C,sBAAsB,WAAW;IACjC,mBAAmB,QAAQ;IAC3B,aAAa,mBAAmB;IAChC,gBAAgB,sBAAsB;IACtC,gBAAgB,sBAAsB;IACtC,gBAAgB,sBAAsB;IACtC,YAAY,kBAAkB;IAC9B,uBAAuB,8BAA8B;IACrD,QAAQ,aAAa;IACrB,uBAAuB,8BAA8B;IACrD,qBAAqB,sBAAsB;IAC3C,yBAAyB,gCAAgC;IACzD,SAAS,6BAA6B;IACtC,cAAc,oBAAoB;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;IAAE,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,GACnC,IAAI,CASN;AAED;;;;GAIG;AACH,wBAAgB,8BAA8B,CAC5C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC7B,KAAK,EAAE,OAAO,GACb,IAAI,CAmCN"}
|
|
@@ -2,11 +2,10 @@
|
|
|
2
2
|
// Copyright (c) Microsoft Corporation.
|
|
3
3
|
// Licensed under the MIT license.
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.sendTelemetryErrorEvent = exports.sendTelemetryEvent = exports.ProjectMigratorGuideStatus = exports.ProjectMigratorStatus = exports.CustomizeSubscriptionType = exports.CustomizeResourceGroupType = exports.Component = exports.TelemetryErrorType = exports.TelemetrySuccess = exports.TelemetryEvent = exports.TelemetryProperty =
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
exports.TelemetryReporterInstance = TelemetryReporterInstance;
|
|
5
|
+
exports.fillInTelemetryPropsForFxError = exports.sendTelemetryErrorEvent = exports.sendTelemetryEvent = exports.ProjectMigratorGuideStatus = exports.ProjectMigratorStatus = exports.CustomizeSubscriptionType = exports.CustomizeResourceGroupType = exports.Component = exports.TelemetryErrorType = exports.TelemetrySuccess = exports.TelemetryEvent = exports.TelemetryProperty = void 0;
|
|
6
|
+
const teamsfx_api_1 = require("@microsoft/teamsfx-api");
|
|
7
|
+
const constants_1 = require("../component/constants");
|
|
8
|
+
const globalVars_1 = require("../core/globalVars");
|
|
10
9
|
var TelemetryProperty;
|
|
11
10
|
(function (TelemetryProperty) {
|
|
12
11
|
TelemetryProperty["TriggerFrom"] = "trigger-from";
|
|
@@ -168,7 +167,7 @@ function sendTelemetryEvent(component, eventName, properties, measurements) {
|
|
|
168
167
|
properties = {};
|
|
169
168
|
}
|
|
170
169
|
properties[TelemetryProperty.Component] = component;
|
|
171
|
-
(_a =
|
|
170
|
+
(_a = globalVars_1.TOOLS.telemetryReporter) === null || _a === void 0 ? void 0 : _a.sendTelemetryEvent(eventName, properties, measurements);
|
|
172
171
|
}
|
|
173
172
|
exports.sendTelemetryEvent = sendTelemetryEvent;
|
|
174
173
|
function sendTelemetryErrorEvent(component, eventName, fxError, properties) {
|
|
@@ -177,8 +176,43 @@ function sendTelemetryErrorEvent(component, eventName, fxError, properties) {
|
|
|
177
176
|
properties = {};
|
|
178
177
|
}
|
|
179
178
|
properties[TelemetryProperty.Component] = component;
|
|
180
|
-
|
|
181
|
-
(_a =
|
|
179
|
+
fillInTelemetryPropsForFxError(properties, fxError);
|
|
180
|
+
(_a = globalVars_1.TOOLS.telemetryReporter) === null || _a === void 0 ? void 0 : _a.sendTelemetryErrorEvent(eventName, properties, {});
|
|
182
181
|
}
|
|
183
182
|
exports.sendTelemetryErrorEvent = sendTelemetryErrorEvent;
|
|
183
|
+
/**
|
|
184
|
+
* fill in telemetry properties for FxError
|
|
185
|
+
* @param error FxError
|
|
186
|
+
* @param props teletry properties
|
|
187
|
+
*/
|
|
188
|
+
function fillInTelemetryPropsForFxError(props, error) {
|
|
189
|
+
const errorCode = error.source + "." + error.name;
|
|
190
|
+
const errorType = error instanceof teamsfx_api_1.SystemError
|
|
191
|
+
? constants_1.TelemetryConstants.values.systemError
|
|
192
|
+
: constants_1.TelemetryConstants.values.userError;
|
|
193
|
+
props[constants_1.TelemetryConstants.properties.success] = constants_1.TelemetryConstants.values.no;
|
|
194
|
+
props[constants_1.TelemetryConstants.properties.errorCode] =
|
|
195
|
+
props[constants_1.TelemetryConstants.properties.errorCode] || errorCode;
|
|
196
|
+
props[constants_1.TelemetryConstants.properties.errorType] = errorType;
|
|
197
|
+
props[constants_1.TelemetryConstants.properties.errorMessage] = error.message;
|
|
198
|
+
props[constants_1.TelemetryConstants.properties.errorStack] = error.stack !== undefined ? error.stack : ""; // error stack will not append in error-message any more
|
|
199
|
+
props[constants_1.TelemetryConstants.properties.errorName] = error.name;
|
|
200
|
+
// append global context properties
|
|
201
|
+
props[constants_1.TelemetryConstants.properties.errorComponent] = globalVars_1.globalVars.component;
|
|
202
|
+
props[constants_1.TelemetryConstants.properties.errorStage] = globalVars_1.globalVars.stage;
|
|
203
|
+
props[constants_1.TelemetryConstants.properties.errorMethod] = globalVars_1.globalVars.method;
|
|
204
|
+
props[constants_1.TelemetryConstants.properties.errorSource] = globalVars_1.globalVars.source;
|
|
205
|
+
if (error.innerError && error.innerError["code"]) {
|
|
206
|
+
props[constants_1.TelemetryConstants.properties.errorInnerCode] = error.innerError["code"];
|
|
207
|
+
}
|
|
208
|
+
if (error.innerError) {
|
|
209
|
+
props[constants_1.TelemetryConstants.properties.innerError] = JSON.stringify(error.innerError, Object.getOwnPropertyNames(error.innerError));
|
|
210
|
+
}
|
|
211
|
+
if (error.categories) {
|
|
212
|
+
props[constants_1.TelemetryConstants.properties.errorCat1] = error.categories[0];
|
|
213
|
+
props[constants_1.TelemetryConstants.properties.errorCat2] = error.categories[1];
|
|
214
|
+
props[constants_1.TelemetryConstants.properties.errorCat3] = error.categories[2];
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
exports.fillInTelemetryPropsForFxError = fillInTelemetryPropsForFxError;
|
|
184
218
|
//# sourceMappingURL=telemetry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"telemetry.js","sourceRoot":"","sources":["../../src/common/telemetry.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;
|
|
1
|
+
{"version":3,"file":"telemetry.js","sourceRoot":"","sources":["../../src/common/telemetry.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC,wDAA8D;AAC9D,sDAA4D;AAC5D,mDAAuD;AAEvD,IAAY,iBA0CX;AA1CD,WAAY,iBAAiB;IAC3B,iDAA4B,CAAA;IAC5B,4CAAuB,CAAA;IACvB,8CAAyB,CAAA;IACzB,wCAAmB,CAAA;IACnB,wCAAmB,CAAA;IACnB,oCAAe,CAAA;IAC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CAAC;KACtE;AACH,CAAC;AAtCD,wEAsCC"}
|
|
@@ -72,7 +72,6 @@ export declare type ExecutionResult = {
|
|
|
72
72
|
export interface ILifecycle {
|
|
73
73
|
name: LifecycleName;
|
|
74
74
|
driverDefs: DriverDefinition[];
|
|
75
|
-
run(ctx: DriverContext): Promise<Result<Output, FxError>>;
|
|
76
75
|
/**
|
|
77
76
|
* Resolve all placeholders in the driver's arguments based on the environment variables in-place.
|
|
78
77
|
* Unresolved placeholders will be returned. It can be used to get unresolved placeholders before actually
|