@microsoft/teamsfx-core 2.0.8-alpha.e17ffd4d1.0 → 2.0.8-alpha.f2bd7316b.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 +6 -19
- package/build/common/constants.d.ts.map +1 -1
- package/build/common/constants.js +6 -20
- package/build/common/constants.js.map +1 -1
- package/build/common/deps-checker/constant/message.d.ts +1 -1
- package/build/common/deps-checker/constant/message.d.ts.map +1 -1
- package/build/common/deps-checker/constant/message.js +1 -1
- package/build/common/deps-checker/constant/message.js.map +1 -1
- package/build/common/deps-checker/util/fileHelper.js +1 -1
- package/build/common/deps-checker/util/fileHelper.js.map +1 -1
- package/build/common/featureFlags.d.ts +70 -7
- package/build/common/featureFlags.d.ts.map +1 -1
- package/build/common/featureFlags.js +66 -42
- package/build/common/featureFlags.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 +3 -6
- package/build/common/m365/launchHelper.js.map +1 -1
- package/build/common/m365/packageService.d.ts +1 -1
- package/build/common/m365/packageService.d.ts.map +1 -1
- package/build/common/m365/packageService.js +18 -39
- package/build/common/m365/packageService.js.map +1 -1
- package/build/common/projectSettingsHelper.d.ts +7 -2
- package/build/common/projectSettingsHelper.d.ts.map +1 -1
- package/build/common/projectSettingsHelper.js +25 -7
- package/build/common/projectSettingsHelper.js.map +1 -1
- package/build/common/projectTypeChecker.d.ts +2 -0
- package/build/common/projectTypeChecker.d.ts.map +1 -1
- package/build/common/projectTypeChecker.js +13 -0
- package/build/common/projectTypeChecker.js.map +1 -1
- package/build/common/samples.d.ts +1 -2
- package/build/common/samples.d.ts.map +1 -1
- package/build/common/samples.js +37 -83
- package/build/common/samples.js.map +1 -1
- package/build/common/stringUtils.d.ts +10 -0
- package/build/common/stringUtils.d.ts.map +1 -0
- package/build/common/stringUtils.js +121 -0
- package/build/common/stringUtils.js.map +1 -0
- package/build/common/telemetry.d.ts +14 -2
- package/build/common/telemetry.d.ts.map +1 -1
- package/build/common/telemetry.js +36 -6
- package/build/common/telemetry.js.map +1 -1
- package/build/common/templates-config.json +1 -1
- package/build/common/wrappedAxiosClient.d.ts.map +1 -1
- package/build/common/wrappedAxiosClient.js +7 -5
- package/build/common/wrappedAxiosClient.js.map +1 -1
- package/build/component/configManager/constant.d.ts +2 -1
- package/build/component/configManager/constant.d.ts.map +1 -1
- package/build/component/configManager/constant.js +1 -0
- package/build/component/configManager/constant.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.js +2 -2
- package/build/component/constants.js.map +1 -1
- package/build/component/coordinator/index.d.ts +0 -38
- package/build/component/coordinator/index.d.ts.map +1 -1
- package/build/component/coordinator/index.js +133 -199
- package/build/component/coordinator/index.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 +22 -11
- package/build/component/driver/aad/create.js.map +1 -1
- package/build/component/driver/aad/error/aadManifestError.d.ts +6 -0
- package/build/component/driver/aad/error/aadManifestError.d.ts.map +1 -1
- package/build/component/driver/aad/error/aadManifestError.js +25 -1
- package/build/component/driver/aad/error/aadManifestError.js.map +1 -1
- package/build/component/driver/aad/error/clientSecretNotAllowedError.d.ts +5 -0
- package/build/component/driver/aad/error/clientSecretNotAllowedError.d.ts.map +1 -0
- package/build/component/driver/aad/error/clientSecretNotAllowedError.js +23 -0
- package/build/component/driver/aad/error/clientSecretNotAllowedError.js.map +1 -0
- package/build/component/driver/aad/error/credentialInvalidLifetimeError.d.ts +5 -0
- package/build/component/driver/aad/error/credentialInvalidLifetimeError.d.ts.map +1 -0
- package/build/component/driver/aad/error/credentialInvalidLifetimeError.js +23 -0
- package/build/component/driver/aad/error/credentialInvalidLifetimeError.js.map +1 -0
- package/build/component/driver/aad/interface/IAADDefinition.d.ts +1 -0
- package/build/component/driver/aad/interface/IAADDefinition.d.ts.map +1 -1
- package/build/component/driver/aad/interface/createAadAppArgs.d.ts +3 -0
- package/build/component/driver/aad/interface/createAadAppArgs.d.ts.map +1 -1
- package/build/component/driver/aad/permissions/index.d.ts.map +1 -1
- package/build/component/driver/aad/permissions/index.js +9 -0
- package/build/component/driver/aad/permissions/index.js.map +1 -1
- package/build/component/driver/aad/utility/aadAppClient.d.ts +3 -2
- package/build/component/driver/aad/utility/aadAppClient.d.ts.map +1 -1
- package/build/component/driver/aad/utility/aadAppClient.js +35 -17
- package/build/component/driver/aad/utility/aadAppClient.js.map +1 -1
- package/build/component/driver/aad/utility/aadManifestHelper.d.ts.map +1 -1
- package/build/component/driver/aad/utility/aadManifestHelper.js +9 -1
- package/build/component/driver/aad/utility/aadManifestHelper.js.map +1 -1
- package/build/component/driver/aad/utility/constants.d.ts +6 -0
- package/build/component/driver/aad/utility/constants.d.ts.map +1 -1
- package/build/component/driver/aad/utility/constants.js +8 -2
- package/build/component/driver/aad/utility/constants.js.map +1 -1
- package/build/component/driver/apiKey/create.d.ts +0 -3
- package/build/component/driver/apiKey/create.d.ts.map +1 -1
- package/build/component/driver/apiKey/create.js +23 -48
- package/build/component/driver/apiKey/create.js.map +1 -1
- package/build/component/driver/apiKey/interface/createApiKeyArgs.d.ts +2 -0
- package/build/component/driver/apiKey/interface/createApiKeyArgs.d.ts.map +1 -1
- package/build/component/driver/apiKey/interface/updateApiKeyArgs.d.ts +9 -0
- package/build/component/driver/apiKey/interface/updateApiKeyArgs.d.ts.map +1 -0
- package/build/component/driver/apiKey/interface/updateApiKeyArgs.js +5 -0
- package/build/component/driver/apiKey/interface/updateApiKeyArgs.js.map +1 -0
- package/build/component/driver/apiKey/update.d.ts +13 -0
- package/build/component/driver/apiKey/update.d.ts.map +1 -0
- package/build/component/driver/apiKey/update.js +182 -0
- package/build/component/driver/apiKey/update.js.map +1 -0
- package/build/component/driver/apiKey/utility/constants.d.ts +2 -0
- package/build/component/driver/apiKey/utility/constants.d.ts.map +1 -1
- package/build/component/driver/apiKey/utility/constants.js +2 -0
- package/build/component/driver/apiKey/utility/constants.js.map +1 -1
- package/build/component/driver/apiKey/utility/utility.d.ts +7 -0
- package/build/component/driver/apiKey/utility/utility.d.ts.map +1 -0
- package/build/component/driver/apiKey/utility/utility.js +55 -0
- package/build/component/driver/apiKey/utility/utility.js.map +1 -0
- package/build/component/driver/deploy/spfx/utility/spoClient.d.ts.map +1 -1
- package/build/component/driver/deploy/spfx/utility/spoClient.js +3 -1
- package/build/component/driver/deploy/spfx/utility/spoClient.js.map +1 -1
- package/build/component/driver/index.d.ts +3 -0
- package/build/component/driver/index.d.ts.map +1 -1
- package/build/component/driver/index.js +3 -0
- package/build/component/driver/index.js.map +1 -1
- package/build/component/driver/middleware/addSWADeployTelemetry.js +2 -2
- package/build/component/driver/middleware/addSWADeployTelemetry.js.map +1 -1
- package/build/component/driver/oauth/create.d.ts +12 -0
- package/build/component/driver/oauth/create.d.ts.map +1 -0
- package/build/component/driver/oauth/create.js +193 -0
- package/build/component/driver/oauth/create.js.map +1 -0
- package/build/component/driver/oauth/error/oauthAuthInfoInvalid.d.ts +5 -0
- package/build/component/driver/oauth/error/oauthAuthInfoInvalid.d.ts.map +1 -0
- package/build/component/driver/oauth/error/oauthAuthInfoInvalid.js +21 -0
- package/build/component/driver/oauth/error/oauthAuthInfoInvalid.js.map +1 -0
- package/build/component/driver/oauth/error/oauthDomainInvalid.d.ts +5 -0
- package/build/component/driver/oauth/error/oauthDomainInvalid.d.ts.map +1 -0
- package/build/component/driver/oauth/error/oauthDomainInvalid.js +22 -0
- package/build/component/driver/oauth/error/oauthDomainInvalid.js.map +1 -0
- package/build/component/driver/oauth/error/oauthFailedToGetDomain.d.ts +5 -0
- package/build/component/driver/oauth/error/oauthFailedToGetDomain.d.ts.map +1 -0
- package/build/component/driver/oauth/error/oauthFailedToGetDomain.js +21 -0
- package/build/component/driver/oauth/error/oauthFailedToGetDomain.js.map +1 -0
- package/build/component/driver/oauth/error/oauthNameTooLong.d.ts +5 -0
- package/build/component/driver/oauth/error/oauthNameTooLong.d.ts.map +1 -0
- package/build/component/driver/oauth/error/oauthNameTooLong.js +21 -0
- package/build/component/driver/oauth/error/oauthNameTooLong.js.map +1 -0
- package/build/component/driver/oauth/interface/createOauthArgs.d.ts +12 -0
- package/build/component/driver/oauth/interface/createOauthArgs.d.ts.map +1 -0
- package/build/component/driver/oauth/interface/createOauthArgs.js +5 -0
- package/build/component/driver/oauth/interface/createOauthArgs.js.map +1 -0
- package/build/component/driver/oauth/interface/createOauthOutputs.d.ts +7 -0
- package/build/component/driver/oauth/interface/createOauthOutputs.d.ts.map +1 -0
- package/build/component/driver/oauth/interface/createOauthOutputs.js +10 -0
- package/build/component/driver/oauth/interface/createOauthOutputs.js.map +1 -0
- package/build/component/driver/oauth/interface/updateOauthArgs.d.ts +9 -0
- package/build/component/driver/oauth/interface/updateOauthArgs.d.ts.map +1 -0
- package/build/component/driver/oauth/interface/updateOauthArgs.js +5 -0
- package/build/component/driver/oauth/interface/updateOauthArgs.js.map +1 -0
- package/build/component/driver/oauth/update.d.ts +13 -0
- package/build/component/driver/oauth/update.d.ts.map +1 -0
- package/build/component/driver/oauth/update.js +181 -0
- package/build/component/driver/oauth/update.js.map +1 -0
- package/build/component/driver/oauth/utility/constants.d.ts +13 -0
- package/build/component/driver/oauth/utility/constants.d.ts.map +1 -0
- package/build/component/driver/oauth/utility/constants.js +18 -0
- package/build/component/driver/oauth/utility/constants.js.map +1 -0
- package/build/component/driver/oauth/utility/utility.d.ts +12 -0
- package/build/component/driver/oauth/utility/utility.d.ts.map +1 -0
- package/build/component/driver/oauth/utility/utility.js +90 -0
- package/build/component/driver/oauth/utility/utility.js.map +1 -0
- package/build/component/driver/script/scriptDriver.d.ts.map +1 -1
- package/build/component/driver/script/scriptDriver.js +8 -8
- package/build/component/driver/script/scriptDriver.js.map +1 -1
- package/build/component/driver/teamsApp/clients/appStudioClient.d.ts +11 -3
- package/build/component/driver/teamsApp/clients/appStudioClient.d.ts.map +1 -1
- package/build/component/driver/teamsApp/clients/appStudioClient.js +54 -2
- package/build/component/driver/teamsApp/clients/appStudioClient.js.map +1 -1
- package/build/component/driver/teamsApp/constants.d.ts +4 -0
- package/build/component/driver/teamsApp/constants.d.ts.map +1 -1
- package/build/component/driver/teamsApp/constants.js +4 -0
- package/build/component/driver/teamsApp/constants.js.map +1 -1
- package/build/component/driver/teamsApp/createAppPackage.d.ts +19 -1
- package/build/component/driver/teamsApp/createAppPackage.d.ts.map +1 -1
- package/build/component/driver/teamsApp/createAppPackage.js +97 -26
- package/build/component/driver/teamsApp/createAppPackage.js.map +1 -1
- package/build/component/driver/teamsApp/interfaces/ApiSecretRegistration.d.ts +20 -0
- package/build/component/driver/teamsApp/interfaces/ApiSecretRegistration.d.ts.map +1 -1
- package/build/component/driver/teamsApp/interfaces/ApiSecretRegistration.js.map +1 -1
- package/build/component/driver/teamsApp/interfaces/OauthConfigurationId.d.ts +7 -0
- package/build/component/driver/teamsApp/interfaces/OauthConfigurationId.d.ts.map +1 -0
- package/build/component/driver/teamsApp/interfaces/OauthConfigurationId.js +5 -0
- package/build/component/driver/teamsApp/interfaces/OauthConfigurationId.js.map +1 -0
- package/build/component/driver/teamsApp/interfaces/OauthRegistration.d.ts +44 -0
- package/build/component/driver/teamsApp/interfaces/OauthRegistration.d.ts.map +1 -0
- package/build/component/driver/teamsApp/interfaces/OauthRegistration.js +21 -0
- package/build/component/driver/teamsApp/interfaces/OauthRegistration.js.map +1 -0
- package/build/component/driver/teamsApp/teamsappMgr.d.ts.map +1 -1
- package/build/component/driver/teamsApp/teamsappMgr.js +22 -8
- package/build/component/driver/teamsApp/teamsappMgr.js.map +1 -1
- package/build/component/driver/teamsApp/utils/CopilotGptManifestUtils.d.ts +8 -0
- package/build/component/driver/teamsApp/utils/CopilotGptManifestUtils.d.ts.map +1 -0
- package/build/component/driver/teamsApp/utils/CopilotGptManifestUtils.js +65 -0
- package/build/component/driver/teamsApp/utils/CopilotGptManifestUtils.js.map +1 -0
- package/build/component/driver/teamsApp/utils/ManifestUtils.d.ts.map +1 -1
- package/build/component/driver/teamsApp/utils/ManifestUtils.js +3 -15
- package/build/component/driver/teamsApp/utils/ManifestUtils.js.map +1 -1
- package/build/component/driver/teamsApp/utils/telemetry.d.ts +2 -0
- package/build/component/driver/teamsApp/utils/telemetry.d.ts.map +1 -1
- package/build/component/driver/teamsApp/utils/telemetry.js +2 -0
- package/build/component/driver/teamsApp/utils/telemetry.js.map +1 -1
- package/build/component/driver/teamsApp/utils/utils.d.ts +1 -0
- package/build/component/driver/teamsApp/utils/utils.d.ts.map +1 -1
- package/build/component/driver/teamsApp/utils/utils.js +5 -1
- package/build/component/driver/teamsApp/utils/utils.js.map +1 -1
- package/build/component/driver/teamsApp/validateTestCases.d.ts +18 -0
- package/build/component/driver/teamsApp/validateTestCases.d.ts.map +1 -1
- package/build/component/driver/teamsApp/validateTestCases.js +132 -50
- package/build/component/driver/teamsApp/validateTestCases.js.map +1 -1
- package/build/component/generator/copilotPlugin/generator.d.ts.map +1 -1
- package/build/component/generator/copilotPlugin/generator.js +16 -18
- package/build/component/generator/copilotPlugin/generator.js.map +1 -1
- package/build/component/generator/copilotPlugin/helper.d.ts +3 -2
- package/build/component/generator/copilotPlugin/helper.d.ts.map +1 -1
- package/build/component/generator/copilotPlugin/helper.js +152 -51
- package/build/component/generator/copilotPlugin/helper.js.map +1 -1
- package/build/component/generator/generator.d.ts +4 -2
- package/build/component/generator/generator.d.ts.map +1 -1
- package/build/component/generator/generator.js +11 -7
- package/build/component/generator/generator.js.map +1 -1
- package/build/component/generator/generatorProvider.d.ts +3 -0
- package/build/component/generator/generatorProvider.d.ts.map +1 -0
- package/build/component/generator/generatorProvider.js +15 -0
- package/build/component/generator/generatorProvider.js.map +1 -0
- package/build/component/generator/officeAddin/generator.d.ts +16 -2
- package/build/component/generator/officeAddin/generator.d.ts.map +1 -1
- package/build/component/generator/officeAddin/generator.js +96 -44
- package/build/component/generator/officeAddin/generator.js.map +1 -1
- package/build/component/generator/officeAddin/helperMethods.d.ts +0 -3
- package/build/component/generator/officeAddin/helperMethods.d.ts.map +1 -1
- package/build/component/generator/officeAddin/helperMethods.js +1 -67
- package/build/component/generator/officeAddin/helperMethods.js.map +1 -1
- package/build/component/generator/officeXMLAddin/generator.d.ts +6 -2
- package/build/component/generator/officeXMLAddin/generator.d.ts.map +1 -1
- package/build/component/generator/officeXMLAddin/generator.js +39 -19
- package/build/component/generator/officeXMLAddin/generator.js.map +1 -1
- package/build/component/generator/officeXMLAddin/projectConfig.d.ts +21 -33
- package/build/component/generator/officeXMLAddin/projectConfig.d.ts.map +1 -1
- package/build/component/generator/officeXMLAddin/projectConfig.js +85 -86
- package/build/component/generator/officeXMLAddin/projectConfig.js.map +1 -1
- package/build/component/generator/templates/ssrTabGenerator.d.ts +12 -0
- package/build/component/generator/templates/ssrTabGenerator.d.ts.map +1 -0
- package/build/component/generator/templates/ssrTabGenerator.js +36 -0
- package/build/component/generator/templates/ssrTabGenerator.js.map +1 -0
- package/build/component/generator/templates/templateGenerator.d.ts +12 -0
- package/build/component/generator/templates/templateGenerator.d.ts.map +1 -0
- package/build/component/generator/templates/templateGenerator.js +99 -0
- package/build/component/generator/templates/templateGenerator.js.map +1 -0
- package/build/component/generator/templates/templateInfo.d.ts +10 -0
- package/build/component/generator/templates/templateInfo.d.ts.map +1 -0
- package/build/component/generator/templates/templateInfo.js +3 -0
- package/build/component/generator/templates/templateInfo.js.map +1 -0
- package/build/component/generator/templates/templateNames.d.ts +52 -0
- package/build/component/generator/templates/templateNames.d.ts.map +1 -0
- package/build/component/generator/templates/templateNames.js +303 -0
- package/build/component/generator/templates/templateNames.js.map +1 -0
- package/build/component/generator/templates/templateReplaceMap.d.ts +5 -0
- package/build/component/generator/templates/templateReplaceMap.d.ts.map +1 -0
- package/build/component/generator/templates/templateReplaceMap.js +39 -0
- package/build/component/generator/templates/templateReplaceMap.js.map +1 -0
- 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 +2 -1
- package/build/component/generator/utils.js.map +1 -1
- package/build/component/middleware/actionExecutionMW.d.ts.map +1 -1
- package/build/component/middleware/actionExecutionMW.js +5 -4
- package/build/component/middleware/actionExecutionMW.js.map +1 -1
- package/build/component/middleware/questionMW.d.ts.map +1 -1
- package/build/component/middleware/questionMW.js +9 -1
- package/build/component/middleware/questionMW.js.map +1 -1
- package/build/component/utils/envUtil.d.ts +0 -1
- package/build/component/utils/envUtil.d.ts.map +1 -1
- package/build/component/utils/envUtil.js +1 -13
- package/build/component/utils/envUtil.js.map +1 -1
- package/build/component/utils/metadataGraphPermssion.d.ts +8 -6
- package/build/component/utils/metadataGraphPermssion.d.ts.map +1 -1
- package/build/component/utils/metadataGraphPermssion.js +10 -2
- package/build/component/utils/metadataGraphPermssion.js.map +1 -1
- package/build/component/utils/metadataRscPermission.d.ts +16 -0
- package/build/component/utils/metadataRscPermission.d.ts.map +1 -0
- package/build/component/utils/metadataRscPermission.js +69 -0
- package/build/component/utils/metadataRscPermission.js.map +1 -0
- package/build/component/utils/metadataUtil.d.ts.map +1 -1
- package/build/component/utils/metadataUtil.js +2 -0
- package/build/component/utils/metadataUtil.js.map +1 -1
- package/build/component/utils.d.ts +2 -1
- package/build/component/utils.d.ts.map +1 -1
- package/build/component/utils.js +43 -1
- package/build/component/utils.js.map +1 -1
- package/build/core/FxCore.d.ts +6 -5
- package/build/core/FxCore.d.ts.map +1 -1
- package/build/core/FxCore.js +138 -26
- package/build/core/FxCore.js.map +1 -1
- package/build/error/common.js +1 -1
- package/build/error/common.js.map +1 -1
- package/build/error/script.d.ts +2 -2
- package/build/error/script.d.ts.map +1 -1
- package/build/error/script.js +6 -6
- package/build/error/script.js.map +1 -1
- package/build/index.d.ts +4 -0
- package/build/index.d.ts.map +1 -1
- package/build/index.js +7 -1
- package/build/index.js.map +1 -1
- package/build/question/constants.d.ts.map +1 -1
- package/build/question/constants.js +6 -1
- package/build/question/constants.js.map +1 -1
- package/build/question/create.d.ts +22 -8
- package/build/question/create.d.ts.map +1 -1
- package/build/question/create.js +386 -235
- package/build/question/create.js.map +1 -1
- package/build/question/index.d.ts +1 -0
- package/build/question/index.d.ts.map +1 -1
- package/build/question/index.js +3 -0
- package/build/question/index.js.map +1 -1
- package/build/question/inputs/CreateProjectInputs.d.ts +9 -7
- 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 +40 -12
- package/build/question/options/CreateProjectOptions.js.map +1 -1
- package/build/question/other.d.ts +1 -0
- package/build/question/other.d.ts.map +1 -1
- package/build/question/other.js +86 -1
- package/build/question/other.js.map +1 -1
- package/build/question/questionNames.d.ts +4 -1
- package/build/question/questionNames.d.ts.map +1 -1
- package/build/question/questionNames.js +4 -1
- package/build/question/questionNames.js.map +1 -1
- package/package.json +15 -11
- package/resource/package.nls.json +115 -56
- package/resource/yaml-schema/v1.5/yaml.schema.json +1784 -0
- package/resource/yaml-schema/yaml.schema.json +198 -2
- package/templates/fallback/common.zip +0 -0
- package/templates/fallback/csharp.zip +0 -0
- package/templates/fallback/js.zip +0 -0
- package/templates/fallback/python.zip +0 -0
- package/templates/fallback/ts.zip +0 -0
- package/build/component/generator/officeAddin/config/projectsJsonData.d.ts +0 -26
- package/build/component/generator/officeAddin/config/projectsJsonData.d.ts.map +0 -1
- package/build/component/generator/officeAddin/config/projectsJsonData.js +0 -165
- package/build/component/generator/officeAddin/config/projectsJsonData.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauthAuthInfoInvalid.d.ts","sourceRoot":"","sources":["../../../../../src/component/driver/oauth/error/oauthAuthInfoInvalid.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAMnD,qBAAa,oBAAqB,SAAQ,SAAS;gBACrC,UAAU,EAAE,MAAM;CAQ/B"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Microsoft Corporation.
|
|
3
|
+
// Licensed under the MIT license.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.OauthAuthInfoInvalid = void 0;
|
|
6
|
+
const teamsfx_api_1 = require("@microsoft/teamsfx-api");
|
|
7
|
+
const localizeUtils_1 = require("../../../../common/localizeUtils");
|
|
8
|
+
const errorCode = "OauthAuthInfoInvalid";
|
|
9
|
+
const messageKey = "driver.apiKey.error.oauthAuthInfoInvalid";
|
|
10
|
+
class OauthAuthInfoInvalid extends teamsfx_api_1.UserError {
|
|
11
|
+
constructor(actionName) {
|
|
12
|
+
super({
|
|
13
|
+
source: actionName,
|
|
14
|
+
name: errorCode,
|
|
15
|
+
message: localizeUtils_1.getDefaultString(messageKey),
|
|
16
|
+
displayMessage: localizeUtils_1.getLocalizedString(messageKey),
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.OauthAuthInfoInvalid = OauthAuthInfoInvalid;
|
|
21
|
+
//# sourceMappingURL=oauthAuthInfoInvalid.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauthAuthInfoInvalid.js","sourceRoot":"","sources":["../../../../../src/component/driver/oauth/error/oauthAuthInfoInvalid.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC,wDAAmD;AACnD,oEAAwF;AAExF,MAAM,SAAS,GAAG,sBAAsB,CAAC;AACzC,MAAM,UAAU,GAAG,0CAA0C,CAAC;AAE9D,MAAa,oBAAqB,SAAQ,uBAAS;IACjD,YAAY,UAAkB;QAC5B,KAAK,CAAC;YACJ,MAAM,EAAE,UAAU;YAClB,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,gCAAgB,CAAC,UAAU,CAAC;YACrC,cAAc,EAAE,kCAAkB,CAAC,UAAU,CAAC;SAC/C,CAAC,CAAC;IACL,CAAC;CACF;AATD,oDASC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauthDomainInvalid.d.ts","sourceRoot":"","sources":["../../../../../src/component/driver/oauth/error/oauthDomainInvalid.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAOnD,qBAAa,uBAAwB,SAAQ,SAAS;gBACxC,UAAU,EAAE,MAAM;CAQ/B"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Microsoft Corporation.
|
|
3
|
+
// Licensed under the MIT license.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.OauthDomainInvalidError = void 0;
|
|
6
|
+
const teamsfx_api_1 = require("@microsoft/teamsfx-api");
|
|
7
|
+
const localizeUtils_1 = require("../../../../common/localizeUtils");
|
|
8
|
+
const constants_1 = require("../utility/constants");
|
|
9
|
+
const errorCode = "OauthDomainInvalid";
|
|
10
|
+
const messageKey = "driver.oauth.error.domainInvalid";
|
|
11
|
+
class OauthDomainInvalidError extends teamsfx_api_1.UserError {
|
|
12
|
+
constructor(actionName) {
|
|
13
|
+
super({
|
|
14
|
+
source: actionName,
|
|
15
|
+
name: errorCode,
|
|
16
|
+
message: localizeUtils_1.getDefaultString(messageKey),
|
|
17
|
+
displayMessage: localizeUtils_1.getLocalizedString(messageKey, constants_1.maxDomainPerOauth),
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.OauthDomainInvalidError = OauthDomainInvalidError;
|
|
22
|
+
//# sourceMappingURL=oauthDomainInvalid.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauthDomainInvalid.js","sourceRoot":"","sources":["../../../../../src/component/driver/oauth/error/oauthDomainInvalid.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC,wDAAmD;AACnD,oEAAwF;AACxF,oDAAyD;AAEzD,MAAM,SAAS,GAAG,oBAAoB,CAAC;AACvC,MAAM,UAAU,GAAG,kCAAkC,CAAC;AAEtD,MAAa,uBAAwB,SAAQ,uBAAS;IACpD,YAAY,UAAkB;QAC5B,KAAK,CAAC;YACJ,MAAM,EAAE,UAAU;YAClB,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,gCAAgB,CAAC,UAAU,CAAC;YACrC,cAAc,EAAE,kCAAkB,CAAC,UAAU,EAAE,6BAAiB,CAAC;SAClE,CAAC,CAAC;IACL,CAAC;CACF;AATD,0DASC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauthFailedToGetDomain.d.ts","sourceRoot":"","sources":["../../../../../src/component/driver/oauth/error/oauthFailedToGetDomain.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAMnD,qBAAa,2BAA4B,SAAQ,SAAS;gBAC5C,UAAU,EAAE,MAAM;CAQ/B"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Microsoft Corporation.
|
|
3
|
+
// Licensed under the MIT license.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.OauthFailedToGetDomainError = void 0;
|
|
6
|
+
const teamsfx_api_1 = require("@microsoft/teamsfx-api");
|
|
7
|
+
const localizeUtils_1 = require("../../../../common/localizeUtils");
|
|
8
|
+
const errorCode = "OauthFailedToGetDomain";
|
|
9
|
+
const messageKey = "driver.apiKey.error.failedToGetDomain";
|
|
10
|
+
class OauthFailedToGetDomainError extends teamsfx_api_1.UserError {
|
|
11
|
+
constructor(actionName) {
|
|
12
|
+
super({
|
|
13
|
+
source: actionName,
|
|
14
|
+
name: errorCode,
|
|
15
|
+
message: localizeUtils_1.getDefaultString(messageKey),
|
|
16
|
+
displayMessage: localizeUtils_1.getLocalizedString(messageKey),
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.OauthFailedToGetDomainError = OauthFailedToGetDomainError;
|
|
21
|
+
//# sourceMappingURL=oauthFailedToGetDomain.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauthFailedToGetDomain.js","sourceRoot":"","sources":["../../../../../src/component/driver/oauth/error/oauthFailedToGetDomain.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC,wDAAmD;AACnD,oEAAwF;AAExF,MAAM,SAAS,GAAG,wBAAwB,CAAC;AAC3C,MAAM,UAAU,GAAG,uCAAuC,CAAC;AAE3D,MAAa,2BAA4B,SAAQ,uBAAS;IACxD,YAAY,UAAkB;QAC5B,KAAK,CAAC;YACJ,MAAM,EAAE,UAAU;YAClB,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,gCAAgB,CAAC,UAAU,CAAC;YACrC,cAAc,EAAE,kCAAkB,CAAC,UAAU,CAAC;SAC/C,CAAC,CAAC;IACL,CAAC;CACF;AATD,kEASC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauthNameTooLong.d.ts","sourceRoot":"","sources":["../../../../../src/component/driver/oauth/error/oauthNameTooLong.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAMnD,qBAAa,qBAAsB,SAAQ,SAAS;gBACtC,UAAU,EAAE,MAAM;CAQ/B"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Microsoft Corporation.
|
|
3
|
+
// Licensed under the MIT license.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.OauthNameTooLongError = void 0;
|
|
6
|
+
const teamsfx_api_1 = require("@microsoft/teamsfx-api");
|
|
7
|
+
const localizeUtils_1 = require("../../../../common/localizeUtils");
|
|
8
|
+
const errorCode = "OauthNameTooLong";
|
|
9
|
+
const messageKey = "driver.oauth.error.nameTooLong";
|
|
10
|
+
class OauthNameTooLongError extends teamsfx_api_1.UserError {
|
|
11
|
+
constructor(actionName) {
|
|
12
|
+
super({
|
|
13
|
+
source: actionName,
|
|
14
|
+
name: errorCode,
|
|
15
|
+
message: localizeUtils_1.getDefaultString(messageKey),
|
|
16
|
+
displayMessage: localizeUtils_1.getLocalizedString(messageKey),
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.OauthNameTooLongError = OauthNameTooLongError;
|
|
21
|
+
//# sourceMappingURL=oauthNameTooLong.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauthNameTooLong.js","sourceRoot":"","sources":["../../../../../src/component/driver/oauth/error/oauthNameTooLong.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC,wDAAmD;AACnD,oEAAwF;AAExF,MAAM,SAAS,GAAG,kBAAkB,CAAC;AACrC,MAAM,UAAU,GAAG,gCAAgC,CAAC;AAEpD,MAAa,qBAAsB,SAAQ,uBAAS;IAClD,YAAY,UAAkB;QAC5B,KAAK,CAAC;YACJ,MAAM,EAAE,UAAU;YAClB,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,gCAAgB,CAAC,UAAU,CAAC;YACrC,cAAc,EAAE,kCAAkB,CAAC,UAAU,CAAC;SAC/C,CAAC,CAAC;IACL,CAAC;CACF;AATD,sDASC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface CreateOauthArgs {
|
|
2
|
+
name: string;
|
|
3
|
+
appId: string;
|
|
4
|
+
apiSpecPath: string;
|
|
5
|
+
applicableToApps?: string;
|
|
6
|
+
targetAudience?: string;
|
|
7
|
+
flow: string;
|
|
8
|
+
clientId?: string;
|
|
9
|
+
clientSecret?: string;
|
|
10
|
+
refreshUrl?: string;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=createOauthArgs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createOauthArgs.d.ts","sourceRoot":"","sources":["../../../../../src/component/driver/oauth/interface/createOauthArgs.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createOauthArgs.js","sourceRoot":"","sources":["../../../../../src/component/driver/oauth/interface/createOauthArgs.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createOauthOutputs.d.ts","sourceRoot":"","sources":["../../../../../src/component/driver/oauth/interface/createOauthOutputs.ts"],"names":[],"mappings":"AAGA,oBAAY,kBAAkB,GAAG;IAC/B,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC;AAGF,eAAO,MAAM,UAAU;;CAEtB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Microsoft Corporation.
|
|
3
|
+
// Licensed under the MIT license.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.OutputKeys = void 0;
|
|
6
|
+
// The const is used to reference the property name in CreateAadAppOutput. When renaming the properties in CreateAadAppOutput, you need to update the const as well.
|
|
7
|
+
exports.OutputKeys = {
|
|
8
|
+
configurationId: "configurationId",
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=createOauthOutputs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createOauthOutputs.js","sourceRoot":"","sources":["../../../../../src/component/driver/oauth/interface/createOauthOutputs.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAMlC,oKAAoK;AACvJ,QAAA,UAAU,GAAG;IACxB,eAAe,EAAE,iBAAiB;CACnC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"updateOauthArgs.d.ts","sourceRoot":"","sources":["../../../../../src/component/driver/oauth/interface/updateOauthArgs.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"updateOauthArgs.js","sourceRoot":"","sources":["../../../../../src/component/driver/oauth/interface/updateOauthArgs.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ExecutionResult, StepDriver } from "../interface/stepDriver";
|
|
2
|
+
import { UpdateOauthArgs } from "./interface/updateOauthArgs";
|
|
3
|
+
import { DriverContext } from "../interface/commonArgs";
|
|
4
|
+
export declare class UpdateOauthDriver implements StepDriver {
|
|
5
|
+
description: string;
|
|
6
|
+
readonly progressTitle: string;
|
|
7
|
+
execute(args: UpdateOauthArgs, context: DriverContext, outputEnvVarNames?: Map<string, string>): Promise<ExecutionResult>;
|
|
8
|
+
private validateArgs;
|
|
9
|
+
private compareOauthRegistration;
|
|
10
|
+
private shouldSkipConfirm;
|
|
11
|
+
private mapArgsToOauthRegistration;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=update.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../../src/component/driver/oauth/update.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAGtE,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAkBxD,qBACa,iBAAkB,YAAW,UAAU;IAClD,WAAW,SAAyD;IACpE,QAAQ,CAAC,aAAa,SAAmD;IAG5D,OAAO,CAClB,IAAI,EAAE,eAAe,EACrB,OAAO,EAAE,aAAa,EACtB,iBAAiB,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GACtC,OAAO,CAAC,eAAe,CAAC;IA0F3B,OAAO,CAAC,YAAY;IA2CpB,OAAO,CAAC,wBAAwB;IAyChC,OAAO,CAAC,iBAAiB;IAUzB,OAAO,CAAC,0BAA0B;CAgBnC"}
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Microsoft Corporation.
|
|
3
|
+
// Licensed under the MIT license.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.UpdateOauthDriver = void 0;
|
|
6
|
+
const tslib_1 = require("tslib");
|
|
7
|
+
const hooks_1 = require("@feathersjs/hooks");
|
|
8
|
+
const localizeUtils_1 = require("../../../common/localizeUtils");
|
|
9
|
+
const addStartAndEndTelemetry_1 = require("../middleware/addStartAndEndTelemetry");
|
|
10
|
+
const teamsfx_api_1 = require("@microsoft/teamsfx-api");
|
|
11
|
+
const constants_1 = require("./utility/constants");
|
|
12
|
+
const common_1 = require("../../../error/common");
|
|
13
|
+
const oauthNameTooLong_1 = require("./error/oauthNameTooLong");
|
|
14
|
+
const OauthRegistration_1 = require("../teamsApp/interfaces/OauthRegistration");
|
|
15
|
+
const appStudioClient_1 = require("../teamsApp/clients/appStudioClient");
|
|
16
|
+
const constants_2 = require("../teamsApp/constants");
|
|
17
|
+
const utility_1 = require("./utility/utility");
|
|
18
|
+
const typedi_1 = require("typedi");
|
|
19
|
+
const actionName = "oauth/update"; // DO NOT MODIFY the name
|
|
20
|
+
const helpLink = "https://aka.ms/teamsfx-actions/oauth-update";
|
|
21
|
+
let UpdateOauthDriver = class UpdateOauthDriver {
|
|
22
|
+
constructor() {
|
|
23
|
+
this.description = localizeUtils_1.getLocalizedString("driver.oauth.description.create");
|
|
24
|
+
this.progressTitle = localizeUtils_1.getLocalizedString("driver.oauth.title.create");
|
|
25
|
+
}
|
|
26
|
+
async execute(args, context, outputEnvVarNames) {
|
|
27
|
+
var _a, _b, _c, _d, _e;
|
|
28
|
+
const summaries = [];
|
|
29
|
+
const outputs = new Map();
|
|
30
|
+
try {
|
|
31
|
+
(_a = context.logProvider) === null || _a === void 0 ? void 0 : _a.info(localizeUtils_1.getLocalizedString(constants_1.logMessageKeys.startExecuteDriver, actionName));
|
|
32
|
+
this.validateArgs(args);
|
|
33
|
+
const authInfo = await utility_1.getandValidateOauthInfoFromSpec(args, context, actionName);
|
|
34
|
+
const domain = authInfo.domain;
|
|
35
|
+
const appStudioTokenRes = await context.m365TokenProvider.getAccessToken({
|
|
36
|
+
scopes: constants_2.AppStudioScopes,
|
|
37
|
+
});
|
|
38
|
+
if (appStudioTokenRes.isErr()) {
|
|
39
|
+
throw appStudioTokenRes.error;
|
|
40
|
+
}
|
|
41
|
+
const appStudioToken = appStudioTokenRes.value;
|
|
42
|
+
const getOauthRes = await appStudioClient_1.AppStudioClient.getOauthRegistrationById(appStudioToken, args.configurationId);
|
|
43
|
+
const diffMsgs = this.compareOauthRegistration(getOauthRes, args, domain);
|
|
44
|
+
// If there is no difference, skip the update
|
|
45
|
+
if (!diffMsgs || diffMsgs.length === 0) {
|
|
46
|
+
const summary = localizeUtils_1.getLocalizedString(constants_1.logMessageKeys.skipUpdateOauth);
|
|
47
|
+
(_b = context.logProvider) === null || _b === void 0 ? void 0 : _b.info(summary);
|
|
48
|
+
summaries.push(summary);
|
|
49
|
+
return {
|
|
50
|
+
result: teamsfx_api_1.ok(outputs),
|
|
51
|
+
summaries: summaries,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
// If there is difference, ask user to confirm the update
|
|
55
|
+
// Skip confirm if only targetUrlsShouldStartWith is different when the url contains devtunnel
|
|
56
|
+
if (!this.shouldSkipConfirm(diffMsgs, getOauthRes.targetUrlsShouldStartWith, domain)) {
|
|
57
|
+
const userConfirm = await context.ui.confirm({
|
|
58
|
+
name: "confirm-update-oauth",
|
|
59
|
+
title: localizeUtils_1.getLocalizedString("driver.oauth.confirm.update", diffMsgs.join(",\n")),
|
|
60
|
+
default: true,
|
|
61
|
+
});
|
|
62
|
+
if (userConfirm.isErr()) {
|
|
63
|
+
throw userConfirm.error;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
const oauth = this.mapArgsToOauthRegistration(args, domain);
|
|
67
|
+
const updateApiKeyRes = await appStudioClient_1.AppStudioClient.updateOauthRegistration(appStudioToken, oauth, args.configurationId);
|
|
68
|
+
void context.ui.showMessage("info", localizeUtils_1.getLocalizedString("driver.oauth.info.update", diffMsgs.join(",\n")), false);
|
|
69
|
+
const summary = localizeUtils_1.getLocalizedString(constants_1.logMessageKeys.successUpdateOauth);
|
|
70
|
+
(_c = context.logProvider) === null || _c === void 0 ? void 0 : _c.info(summary);
|
|
71
|
+
summaries.push(summary);
|
|
72
|
+
return {
|
|
73
|
+
result: teamsfx_api_1.ok(outputs),
|
|
74
|
+
summaries: summaries,
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
catch (error) {
|
|
78
|
+
if (error instanceof teamsfx_api_1.UserError || error instanceof teamsfx_api_1.SystemError) {
|
|
79
|
+
(_d = context.logProvider) === null || _d === void 0 ? void 0 : _d.error(localizeUtils_1.getLocalizedString(constants_1.logMessageKeys.failedExecuteDriver, actionName, error.displayMessage));
|
|
80
|
+
return {
|
|
81
|
+
result: teamsfx_api_1.err(error),
|
|
82
|
+
summaries: summaries,
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
const message = JSON.stringify(error);
|
|
86
|
+
(_e = context.logProvider) === null || _e === void 0 ? void 0 : _e.error(localizeUtils_1.getLocalizedString(constants_1.logMessageKeys.failedExecuteDriver, actionName, message));
|
|
87
|
+
return {
|
|
88
|
+
result: teamsfx_api_1.err(common_1.assembleError(error, actionName)),
|
|
89
|
+
summaries: summaries,
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
validateArgs(args) {
|
|
94
|
+
const invalidParameters = [];
|
|
95
|
+
if (typeof args.configurationId !== "string" || !args.configurationId) {
|
|
96
|
+
invalidParameters.push("registrationId");
|
|
97
|
+
}
|
|
98
|
+
if (typeof args.name !== "string" || !args.name) {
|
|
99
|
+
invalidParameters.push("name");
|
|
100
|
+
}
|
|
101
|
+
if (args.name.length > 128) {
|
|
102
|
+
throw new oauthNameTooLong_1.OauthNameTooLongError(actionName);
|
|
103
|
+
}
|
|
104
|
+
if (typeof args.appId !== "string" || !args.appId) {
|
|
105
|
+
invalidParameters.push("appId");
|
|
106
|
+
}
|
|
107
|
+
if (typeof args.apiSpecPath !== "string" || !args.apiSpecPath) {
|
|
108
|
+
invalidParameters.push("apiSpecPath");
|
|
109
|
+
}
|
|
110
|
+
if (args.applicableToApps &&
|
|
111
|
+
args.applicableToApps !== OauthRegistration_1.OauthRegistrationAppType.AnyApp &&
|
|
112
|
+
args.applicableToApps !== OauthRegistration_1.OauthRegistrationAppType.SpecificApp) {
|
|
113
|
+
invalidParameters.push("applicableToApps");
|
|
114
|
+
}
|
|
115
|
+
if (args.targetAudience &&
|
|
116
|
+
args.targetAudience !== OauthRegistration_1.OauthRegistrationTargetAudience.AnyTenant &&
|
|
117
|
+
args.targetAudience !== OauthRegistration_1.OauthRegistrationTargetAudience.HomeTenant) {
|
|
118
|
+
invalidParameters.push("targetAudience");
|
|
119
|
+
}
|
|
120
|
+
if (invalidParameters.length > 0) {
|
|
121
|
+
throw new common_1.InvalidActionInputError(actionName, invalidParameters, helpLink);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
compareOauthRegistration(current, input, domain) {
|
|
125
|
+
const diffMsgs = [];
|
|
126
|
+
if (current.description !== input.name) {
|
|
127
|
+
diffMsgs.push(`description: ${current.description} => ${input.name}`);
|
|
128
|
+
}
|
|
129
|
+
if (input.applicableToApps && current.applicableToApps !== input.applicableToApps) {
|
|
130
|
+
let msg = `applicableToApps: ${current.applicableToApps} => ${input.applicableToApps}`;
|
|
131
|
+
if (input.applicableToApps === "SpecificApp") {
|
|
132
|
+
msg += `, specificAppId: ${input.appId}`;
|
|
133
|
+
}
|
|
134
|
+
diffMsgs.push(msg);
|
|
135
|
+
}
|
|
136
|
+
if (input.targetAudience && current.targetAudience !== input.targetAudience) {
|
|
137
|
+
diffMsgs.push(`targetAudience: ${current.targetAudience} => ${input.targetAudience}`);
|
|
138
|
+
}
|
|
139
|
+
// Compare domain
|
|
140
|
+
if (current.targetUrlsShouldStartWith.length !== domain.length ||
|
|
141
|
+
!current.targetUrlsShouldStartWith.every((value) => domain.includes(value)) ||
|
|
142
|
+
!domain.every((value) => current.targetUrlsShouldStartWith.includes(value))) {
|
|
143
|
+
diffMsgs.push(`targetUrlsShouldStartWith: ${current.targetUrlsShouldStartWith.join(",")} => ${domain.join(",")}`);
|
|
144
|
+
}
|
|
145
|
+
return diffMsgs;
|
|
146
|
+
}
|
|
147
|
+
// Should skip confirm box if only targetUrlsShouldStartWith is different and the url contains devtunnel
|
|
148
|
+
shouldSkipConfirm(diffMsgs, getDomain, domain) {
|
|
149
|
+
return (diffMsgs.length === 1 &&
|
|
150
|
+
diffMsgs[0].includes("targetUrlsShouldStartWith") &&
|
|
151
|
+
getDomain.length === domain.length &&
|
|
152
|
+
getDomain.every((value) => value.includes("devtunnel")) &&
|
|
153
|
+
domain.every((value) => value.includes("devtunnel")));
|
|
154
|
+
}
|
|
155
|
+
mapArgsToOauthRegistration(args, domain) {
|
|
156
|
+
const targetAudience = args.targetAudience
|
|
157
|
+
? args.targetAudience
|
|
158
|
+
: undefined;
|
|
159
|
+
const applicableToApps = args.applicableToApps
|
|
160
|
+
? args.applicableToApps
|
|
161
|
+
: undefined;
|
|
162
|
+
return {
|
|
163
|
+
description: args.name,
|
|
164
|
+
targetUrlsShouldStartWith: domain,
|
|
165
|
+
applicableToApps: applicableToApps,
|
|
166
|
+
specificAppId: applicableToApps === OauthRegistration_1.OauthRegistrationAppType.SpecificApp ? args.appId : "",
|
|
167
|
+
targetAudience: targetAudience,
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
tslib_1.__decorate([
|
|
172
|
+
hooks_1.hooks([addStartAndEndTelemetry_1.addStartAndEndTelemetry(actionName, actionName)]),
|
|
173
|
+
tslib_1.__metadata("design:type", Function),
|
|
174
|
+
tslib_1.__metadata("design:paramtypes", [Object, Object, Map]),
|
|
175
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
176
|
+
], UpdateOauthDriver.prototype, "execute", null);
|
|
177
|
+
UpdateOauthDriver = tslib_1.__decorate([
|
|
178
|
+
typedi_1.Service(actionName)
|
|
179
|
+
], UpdateOauthDriver);
|
|
180
|
+
exports.UpdateOauthDriver = UpdateOauthDriver;
|
|
181
|
+
//# sourceMappingURL=update.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../../../src/component/driver/oauth/update.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;;AAElC,6CAA0C;AAE1C,iEAAmE;AACnE,mFAAgF;AAGhF,wDAAyE;AACzE,mDAAqD;AACrD,kDAA+E;AAC/E,+DAAiE;AACjE,gFAIkD;AAClD,yEAAsE;AACtE,qDAAwD;AACxD,+CAAoE;AACpE,mCAAiC;AAEjC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,SAAS,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;YACvD,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CACrD,CAAC;IACJ,CAAC;IAEO,0BAA0B,CAAC,IAAqB,EAAE,MAAgB;QACxE,MAAM,cAAc,GAAG,IAAI,CAAC,cAAc;YACxC,CAAC,CAAE,IAAI,CAAC,cAAkD;YAC1D,CAAC,CAAC,SAAS,CAAC;QACd,MAAM,gBAAgB,GAAG,IAAI,CAAC,gBAAgB;YAC5C,CAAC,CAAE,IAAI,CAAC,gBAA6C;YACrD,CAAC,CAAC,SAAS,CAAC;QAEd,OAAO;YACL,WAAW,EAAE,IAAI,CAAC,IAAI;YACtB,yBAAyB,EAAE,MAAM;YACjC,gBAAgB,EAAE,gBAAgB;YAClC,aAAa,EAAE,gBAAgB,KAAK,4CAAwB,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE;YAC1F,cAAc,EAAE,cAAc;SACV,CAAC;IACzB,CAAC;CACF,CAAA;AA5MC;IADC,aAAK,CAAC,CAAC,iDAAuB,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC;;6DAInC,GAAG;;gDAyFxB;AAjGU,iBAAiB;IAD7B,gBAAO,CAAC,UAAU,CAAC;GACP,iBAAiB,CAiN7B;AAjNY,8CAAiB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const logMessageKeys: {
|
|
2
|
+
startExecuteDriver: string;
|
|
3
|
+
failedExecuteDriver: string;
|
|
4
|
+
skipCreateOauth: string;
|
|
5
|
+
oauthNotFound: string;
|
|
6
|
+
successCreateOauth: string;
|
|
7
|
+
skipUpdateOauth: string;
|
|
8
|
+
successUpdateOauth: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const maxSecretLength = 128;
|
|
11
|
+
export declare const minSecretLength = 10;
|
|
12
|
+
export declare const maxDomainPerOauth = 1;
|
|
13
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/component/driver/oauth/utility/constants.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,cAAc;;;;;;;;CAQ1B,CAAC;AAEF,eAAO,MAAM,eAAe,MAAM,CAAC;AACnC,eAAO,MAAM,eAAe,KAAK,CAAC;AAClC,eAAO,MAAM,iBAAiB,IAAI,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Microsoft Corporation.
|
|
3
|
+
// Licensed under the MIT license.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.maxDomainPerOauth = exports.minSecretLength = exports.maxSecretLength = exports.logMessageKeys = void 0;
|
|
6
|
+
exports.logMessageKeys = {
|
|
7
|
+
startExecuteDriver: "driver.apiKey.log.startExecuteDriver",
|
|
8
|
+
failedExecuteDriver: "driver.apiKey.log.failedExecuteDriver",
|
|
9
|
+
skipCreateOauth: "driver.oauth.log.skipCreateOauth",
|
|
10
|
+
oauthNotFound: "driver.oauth.log.oauthNotFound",
|
|
11
|
+
successCreateOauth: "driver.oauth.log.successCreateOauth",
|
|
12
|
+
skipUpdateOauth: "driver.oauth.log.skipUpdateOauth",
|
|
13
|
+
successUpdateOauth: "driver.oauth.log.successUpdateOauth",
|
|
14
|
+
};
|
|
15
|
+
exports.maxSecretLength = 128;
|
|
16
|
+
exports.minSecretLength = 10;
|
|
17
|
+
exports.maxDomainPerOauth = 1;
|
|
18
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../src/component/driver/oauth/utility/constants.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAErB,QAAA,cAAc,GAAG;IAC5B,kBAAkB,EAAE,sCAAsC;IAC1D,mBAAmB,EAAE,uCAAuC;IAC5D,eAAe,EAAE,kCAAkC;IACnD,aAAa,EAAE,gCAAgC;IAC/C,kBAAkB,EAAE,qCAAqC;IACzD,eAAe,EAAE,kCAAkC;IACnD,kBAAkB,EAAE,qCAAqC;CAC1D,CAAC;AAEW,QAAA,eAAe,GAAG,GAAG,CAAC;AACtB,QAAA,eAAe,GAAG,EAAE,CAAC;AACrB,QAAA,iBAAiB,GAAG,CAAC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DriverContext } from "../../interface/commonArgs";
|
|
2
|
+
import { CreateOauthArgs } from "../interface/createOauthArgs";
|
|
3
|
+
import { UpdateOauthArgs } from "../interface/updateOauthArgs";
|
|
4
|
+
export interface OauthInfo {
|
|
5
|
+
domain: string[];
|
|
6
|
+
authorizationEndpoint?: string;
|
|
7
|
+
tokenExchangeEndpoint?: string;
|
|
8
|
+
tokenRefreshEndpoint?: string;
|
|
9
|
+
scopes?: string[];
|
|
10
|
+
}
|
|
11
|
+
export declare function getandValidateOauthInfoFromSpec(args: CreateOauthArgs | UpdateOauthArgs, context: DriverContext, actionName: string): Promise<OauthInfo>;
|
|
12
|
+
//# sourceMappingURL=utility.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utility.d.ts","sourceRoot":"","sources":["../../../../../src/component/driver/oauth/utility/utility.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAQ/D,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE/D,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB;AASD,wBAAsB,+BAA+B,CACnD,IAAI,EAAE,eAAe,GAAG,eAAe,EACvC,OAAO,EAAE,aAAa,EACtB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,SAAS,CAAC,CAmEpB"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Microsoft Corporation.
|
|
3
|
+
// Licensed under the MIT license.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.getandValidateOauthInfoFromSpec = void 0;
|
|
6
|
+
const m365_spec_parser_1 = require("@microsoft/m365-spec-parser");
|
|
7
|
+
const common_1 = require("../../../utils/common");
|
|
8
|
+
const featureFlags_1 = require("../../../../common/featureFlags");
|
|
9
|
+
const lodash_1 = require("lodash");
|
|
10
|
+
const constants_1 = require("./constants");
|
|
11
|
+
const oauthDomainInvalid_1 = require("../error/oauthDomainInvalid");
|
|
12
|
+
const oauthFailedToGetDomain_1 = require("../error/oauthFailedToGetDomain");
|
|
13
|
+
const oauthAuthInfoInvalid_1 = require("../error/oauthAuthInfoInvalid");
|
|
14
|
+
async function getandValidateOauthInfoFromSpec(args, context, actionName) {
|
|
15
|
+
const absolutePath = common_1.getAbsolutePath(args.apiSpecPath, context.projectPath);
|
|
16
|
+
const parser = new m365_spec_parser_1.SpecParser(absolutePath, {
|
|
17
|
+
allowAPIKeyAuth: false,
|
|
18
|
+
allowBearerTokenAuth: featureFlags_1.isCopilotAuthEnabled(),
|
|
19
|
+
allowMultipleParameters: true,
|
|
20
|
+
allowOauth2: featureFlags_1.isCopilotAuthEnabled(),
|
|
21
|
+
projectType: m365_spec_parser_1.ProjectType.Copilot,
|
|
22
|
+
allowMissingId: true,
|
|
23
|
+
allowSwagger: true,
|
|
24
|
+
allowMethods: ["get", "post", "put", "delete", "patch", "head", "connect", "options", "trace"],
|
|
25
|
+
});
|
|
26
|
+
const listResult = await parser.list();
|
|
27
|
+
const operations = listResult.APIs.filter((value) => value.isValid).filter((value) => {
|
|
28
|
+
const auth = value.auth;
|
|
29
|
+
return auth && auth.authScheme.type === "oauth2" && auth.name === args.name;
|
|
30
|
+
});
|
|
31
|
+
const domains = operations
|
|
32
|
+
.map((value) => {
|
|
33
|
+
return value.server;
|
|
34
|
+
})
|
|
35
|
+
.filter((value, index, self) => {
|
|
36
|
+
return self.indexOf(value) === index;
|
|
37
|
+
});
|
|
38
|
+
validateDomain(domains, actionName);
|
|
39
|
+
if ("flow" in args) {
|
|
40
|
+
const authInfoArray = operations
|
|
41
|
+
.map((value) => {
|
|
42
|
+
var _a;
|
|
43
|
+
let authInfo;
|
|
44
|
+
switch (args.flow) {
|
|
45
|
+
case "authorizationCode":
|
|
46
|
+
default:
|
|
47
|
+
authInfo = ((_a = value.auth) === null || _a === void 0 ? void 0 : _a.authScheme).flows
|
|
48
|
+
.authorizationCode;
|
|
49
|
+
}
|
|
50
|
+
return {
|
|
51
|
+
authorizationUrl: authInfo.authorizationUrl,
|
|
52
|
+
tokenUrl: authInfo.tokenUrl,
|
|
53
|
+
refreshUrl: authInfo.refreshUrl,
|
|
54
|
+
scopes: Object.keys(authInfo.scopes),
|
|
55
|
+
};
|
|
56
|
+
})
|
|
57
|
+
.reduce((accumulator, currentValue) => {
|
|
58
|
+
if (!accumulator.find((item) => lodash_1.isEqual(item, currentValue))) {
|
|
59
|
+
accumulator.push(currentValue);
|
|
60
|
+
}
|
|
61
|
+
return accumulator;
|
|
62
|
+
}, []);
|
|
63
|
+
if (authInfoArray.length !== 1) {
|
|
64
|
+
throw new oauthAuthInfoInvalid_1.OauthAuthInfoInvalid(actionName);
|
|
65
|
+
}
|
|
66
|
+
const authInfo = authInfoArray[0];
|
|
67
|
+
return {
|
|
68
|
+
domain: domains,
|
|
69
|
+
authorizationEndpoint: authInfo.authorizationUrl,
|
|
70
|
+
tokenExchangeEndpoint: authInfo.tokenUrl,
|
|
71
|
+
tokenRefreshEndpoint: authInfo.refreshUrl,
|
|
72
|
+
scopes: authInfo.scopes,
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
return {
|
|
77
|
+
domain: domains,
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
exports.getandValidateOauthInfoFromSpec = getandValidateOauthInfoFromSpec;
|
|
82
|
+
function validateDomain(domain, actionName) {
|
|
83
|
+
if (domain.length > constants_1.maxDomainPerOauth) {
|
|
84
|
+
throw new oauthDomainInvalid_1.OauthDomainInvalidError(actionName);
|
|
85
|
+
}
|
|
86
|
+
if (domain.length === 0) {
|
|
87
|
+
throw new oauthFailedToGetDomain_1.OauthFailedToGetDomainError(actionName);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=utility.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utility.js","sourceRoot":"","sources":["../../../../../src/component/driver/oauth/utility/utility.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC,kEAAsE;AACtE,kDAAwD;AAGxD,kEAAuE;AAEvE,mCAAiC;AACjC,2CAAgD;AAChD,oEAAsE;AACtE,4EAA8E;AAC9E,wEAAqE;AAkB9D,KAAK,UAAU,+BAA+B,CACnD,IAAuC,EACvC,OAAsB,EACtB,UAAkB;IAElB,MAAM,YAAY,GAAG,wBAAe,CAAC,IAAI,CAAC,WAAW,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IAC5E,MAAM,MAAM,GAAG,IAAI,6BAAU,CAAC,YAAY,EAAE;QAC1C,eAAe,EAAE,KAAK;QACtB,oBAAoB,EAAE,mCAAoB,EAAE;QAC5C,uBAAuB,EAAE,IAAI;QAC7B,WAAW,EAAE,mCAAoB,EAAE;QACnC,WAAW,EAAE,8BAAW,CAAC,OAAO;QA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CAAC,CAAC;KACnD;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scriptDriver.d.ts","sourceRoot":"","sources":["../../../../src/component/driver/script/scriptDriver.ts"],"names":[],"mappings":";AAOA,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,EAAW,MAAM,wBAAwB,CAAC;AAC/E,OAAO,aAAa,MAAM,eAAe,CAAC;AAM1C,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAIjF,OAAO,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"scriptDriver.d.ts","sourceRoot":"","sources":["../../../../src/component/driver/script/scriptDriver.ts"],"names":[],"mappings":";AAOA,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,EAAW,MAAM,wBAAwB,CAAC;AAC/E,OAAO,aAAa,MAAM,eAAe,CAAC;AAM1C,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAIjF,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAMtE,UAAU,gBAAgB;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;GAMG;AACH,wBAAsB,YAAY,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAgBhE;AAED,qBACa,YAAa,YAAW,UAAU;IACvC,IAAI,CACR,SAAS,EAAE,gBAAgB,EAC3B,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,EAA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