@microsoft/teamsfx-core 2.0.8-alpha.a277dba4e.0 → 2.0.8-alpha.ad8f60cf1.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 +5 -18
- package/build/common/constants.d.ts.map +1 -1
- package/build/common/constants.js +5 -19
- 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 -8
- package/build/common/featureFlags.d.ts.map +1 -1
- package/build/common/featureFlags.js +66 -89
- package/build/common/featureFlags.js.map +1 -1
- package/build/common/m365/launchHelper.d.ts.map +1 -1
- package/build/common/m365/launchHelper.js +3 -2
- package/build/common/m365/launchHelper.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/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 +11 -2
- package/build/common/telemetry.d.ts.map +1 -1
- package/build/common/telemetry.js +33 -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/constants.js +2 -2
- package/build/component/constants.js.map +1 -1
- package/build/component/coordinator/index.d.ts +0 -40
- package/build/component/coordinator/index.d.ts.map +1 -1
- package/build/component/coordinator/index.js +128 -179
- package/build/component/coordinator/index.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/utility/aadManifestHelper.d.ts.map +1 -1
- package/build/component/driver/aad/utility/aadManifestHelper.js +7 -0
- package/build/component/driver/aad/utility/aadManifestHelper.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 +4 -49
- package/build/component/driver/apiKey/create.js.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/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 +192 -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 +10 -1
- package/build/component/driver/teamsApp/validateTestCases.d.ts.map +1 -1
- package/build/component/driver/teamsApp/validateTestCases.js +108 -39
- 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 +30 -16
- package/build/component/generator/copilotPlugin/generator.js.map +1 -1
- package/build/component/generator/copilotPlugin/helper.d.ts +2 -2
- package/build/component/generator/copilotPlugin/helper.d.ts.map +1 -1
- package/build/component/generator/copilotPlugin/helper.js +98 -46
- package/build/component/generator/copilotPlugin/helper.js.map +1 -1
- package/build/component/generator/generator.d.ts +2 -1
- package/build/component/generator/generator.d.ts.map +1 -1
- package/build/component/generator/generator.js +5 -3
- 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 +12 -0
- package/build/component/generator/officeAddin/generator.d.ts.map +1 -1
- package/build/component/generator/officeAddin/generator.js +63 -14
- 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 +0 -65
- package/build/component/generator/officeAddin/helperMethods.js.map +1 -1
- package/build/component/generator/officeXMLAddin/generator.d.ts +2 -1
- package/build/component/generator/officeXMLAddin/generator.d.ts.map +1 -1
- package/build/component/generator/officeXMLAddin/generator.js +24 -10
- package/build/component/generator/officeXMLAddin/generator.js.map +1 -1
- package/build/component/generator/officeXMLAddin/projectConfig.d.ts.map +1 -1
- package/build/component/generator/officeXMLAddin/projectConfig.js +14 -2
- 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/metadataRscPermission.js +1 -1
- package/build/component/utils/metadataRscPermission.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 +5 -5
- package/build/core/FxCore.d.ts.map +1 -1
- package/build/core/FxCore.js +96 -29
- 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 +9 -1
- package/build/question/create.d.ts.map +1 -1
- package/build/question/create.js +196 -80
- 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 -3
- 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 +30 -4
- 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 +6 -1
- package/build/question/questionNames.d.ts.map +1 -1
- package/build/question/questionNames.js +5 -0
- package/build/question/questionNames.js.map +1 -1
- package/package.json +11 -7
- package/resource/package.nls.json +102 -46
- package/resource/yaml-schema/v1.5/yaml.schema.json +180 -1
- package/resource/yaml-schema/yaml.schema.json +180 -1
- 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
|
@@ -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,MAAM,UAAU,GAAG,cAAc,CAAC,CAAC,yBAAyB;AAC5D,MAAM,QAAQ,GAAG,6CAA6C,CAAC;AAG/D,IAAa,iBAAiB,GAA9B,MAAa,iBAAiB;IAA9B;QACE,gBAAW,GAAG,kCAAkB,CAAC,iCAAiC,CAAC,CAAC;QAC3D,kBAAa,GAAG,kCAAkB,CAAC,2BAA2B,CAAC,CAAC;IA+M3E,CAAC;IA5MQ,KAAK,CAAC,OAAO,CAClB,IAAqB,EACrB,OAAsB,EACtB,iBAAuC;;QAEvC,MAAM,SAAS,GAAa,EAAE,CAAC;QAC/B,MAAM,OAAO,GAAwB,IAAI,GAAG,EAAkB,CAAC;QAE/D,IAAI;YACF,MAAA,OAAO,CAAC,WAAW,0CAAE,IAAI,CAAC,kCAAkB,CAAC,0BAAc,CAAC,kBAAkB,EAAE,UAAU,CAAC,CAAC,CAAC;YAC7F,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;YAExB,MAAM,QAAQ,GAAG,MAAM,yCAA+B,CAAC,IAAI,EAA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AAC,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","sourceRo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D,MAAM,QAAQ,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC;QAClC,OAAO;YACL,MAAM,EAAE,OAAO;YACf,qBAAqB,EAAE,QAAQ,CAAC,gBAAgB;YAChD,qBAAqB,EAAE,QAAQ,CAAC,QAAQ;YACxC,oBAAoB,EAAE,QAAQ,CAAC,UAAU;YACzC,MAAM,EAAE,QAAQ,CAAC,MAAM;SACxB,CAAC;KACH;SAAM;QACL,OAAO;YACL,MAAM,EAAE,OAAO;SAChB,CAAC;KACH;AACH,CAAC;AAvED,0EAuEC;AAED,SAAS,cAAc,CAAC,MAAgB,EAAE,UAAkB;IAC1D,IAAI,MAAM,CAAC,MAAM,GAAG,6BAAiB,EAAE;QACrC,MAAM,IAAI,4CAAuB,CAAC,UAAU,CAAC,CAAC;KAC/C;IAED,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE;QACvB,MAAM,IAAI,oDAA2B,CAAC,UAAU,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,EAA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AAE,MAAM,EAAE,EACvB,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAClC,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAOxB;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,MAAM,CAM3E;AAED,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,aAAa,CAAC,aAAa,EAClC,GAAG,EAAE,MAAM,GACV,kBAAkB,GAAG,oBAAoB,CAM3C;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,CAYlE;AAED,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEzD"}
|
|
@@ -19,8 +19,8 @@ const script_1 = require("../../../error/script");
|
|
|
19
19
|
const commonConstant_1 = require("../../constant/commonConstant");
|
|
20
20
|
const messages_1 = require("../../messages");
|
|
21
21
|
const charsetUtils_1 = require("../../utils/charsetUtils");
|
|
22
|
-
const envUtil_1 = require("../../utils/envUtil");
|
|
23
22
|
const addStartAndEndTelemetry_1 = require("../middleware/addStartAndEndTelemetry");
|
|
23
|
+
const stringUtils_1 = require("../../../common/stringUtils");
|
|
24
24
|
const ACTION_NAME = "script";
|
|
25
25
|
/**
|
|
26
26
|
* Get the default shell for the current platform:
|
|
@@ -64,7 +64,7 @@ let ScriptDriver = class ScriptDriver {
|
|
|
64
64
|
const typedArgs = args;
|
|
65
65
|
const res = await this._run(typedArgs, ctx);
|
|
66
66
|
const summaries = res.isOk()
|
|
67
|
-
? [`Successfully executed command ${
|
|
67
|
+
? [`Successfully executed command ${stringUtils_1.maskSecretValues(args.run)}`]
|
|
68
68
|
: [];
|
|
69
69
|
return { result: res, summaries: summaries };
|
|
70
70
|
}
|
|
@@ -100,7 +100,7 @@ async function executeCommand(command, projectPath, logProvider, ui, workingDire
|
|
|
100
100
|
if (redirectTo) {
|
|
101
101
|
appendFile = path.isAbsolute(redirectTo) ? redirectTo : path.join(projectPath, redirectTo);
|
|
102
102
|
}
|
|
103
|
-
logProvider.verbose(`Start to run command: "${
|
|
103
|
+
logProvider.verbose(`Start to run command: "${stringUtils_1.maskSecretValues(finalCmd)}" with args: ${JSON.stringify({
|
|
104
104
|
shell: finalShell,
|
|
105
105
|
cwd: workingDir,
|
|
106
106
|
encoding: systemEncoding,
|
|
@@ -126,7 +126,7 @@ async function executeCommand(command, projectPath, logProvider, ui, workingDire
|
|
|
126
126
|
const outputString = allOutputStrings.join("");
|
|
127
127
|
const outputObject = parseSetOutputCommand(outputString);
|
|
128
128
|
if (Object.keys(outputObject).length > 0)
|
|
129
|
-
logProvider.verbose(`script output env variables: ${
|
|
129
|
+
logProvider.verbose(`script output env variables: ${stringUtils_1.maskSecretValues(JSON.stringify(outputObject))}`);
|
|
130
130
|
resolve(teamsfx_api_1.ok([outputString, outputObject]));
|
|
131
131
|
}
|
|
132
132
|
});
|
|
@@ -138,7 +138,7 @@ async function executeCommand(command, projectPath, logProvider, ui, workingDire
|
|
|
138
138
|
};
|
|
139
139
|
(_a = cp.stdout) === null || _a === void 0 ? void 0 : _a.on("data", (data) => {
|
|
140
140
|
const str = bufferToString(data, systemEncoding);
|
|
141
|
-
logProvider.info(` [script stdout] ${
|
|
141
|
+
logProvider.info(` [script stdout] ${stringUtils_1.maskSecretValues(str)}`);
|
|
142
142
|
dataHandler(str);
|
|
143
143
|
});
|
|
144
144
|
const handler = getStderrHandler(logProvider, systemEncoding, stderrStrings, dataHandler);
|
|
@@ -149,7 +149,7 @@ exports.executeCommand = executeCommand;
|
|
|
149
149
|
function getStderrHandler(logProvider, systemEncoding, stderrStrings, dataHandler) {
|
|
150
150
|
return (data) => {
|
|
151
151
|
const str = bufferToString(data, systemEncoding);
|
|
152
|
-
logProvider.warning(` [script stderr] ${
|
|
152
|
+
logProvider.warning(` [script stderr] ${stringUtils_1.maskSecretValues(str)}`);
|
|
153
153
|
dataHandler(str);
|
|
154
154
|
stderrStrings.push(str);
|
|
155
155
|
};
|
|
@@ -164,10 +164,10 @@ function bufferToString(data, systemEncoding) {
|
|
|
164
164
|
exports.bufferToString = bufferToString;
|
|
165
165
|
function convertScriptErrorToFxError(error, run) {
|
|
166
166
|
if (error.killed) {
|
|
167
|
-
return new script_1.ScriptTimeoutError(
|
|
167
|
+
return new script_1.ScriptTimeoutError(error);
|
|
168
168
|
}
|
|
169
169
|
else {
|
|
170
|
-
return new script_1.ScriptExecutionError(
|
|
170
|
+
return new script_1.ScriptExecutionError(error);
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
173
|
exports.convertScriptErrorToFxError = convertScriptErrorToFxError;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scriptDriver.js","sourceRoot":"","sources":["../../../../src/component/driver/script/scriptDriver.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;;AAElC;;GAEG;AACH,6CAA0C;AAC1C,wDAA+E;AAC/E,0EAA0C;AAC1C,gEAA0B;AAC1B,oEAA+B;AAC/B,oDAAoB;AACpB,mDAA6B;AAC7B,mCAAiC;AACjC,kDAAiF;AACjF,kEAAkE;AAClE,6CAAkD;AAClD,2DAA6D;
|
|
1
|
+
{"version":3,"file":"scriptDriver.js","sourceRoot":"","sources":["../../../../src/component/driver/script/scriptDriver.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;;AAElC;;GAEG;AACH,6CAA0C;AAC1C,wDAA+E;AAC/E,0EAA0C;AAC1C,gEAA0B;AAC1B,oEAA+B;AAC/B,oDAAoB;AACpB,mDAA6B;AAC7B,mCAAiC;AACjC,kDAAiF;AACjF,kEAAkE;AAClE,6CAAkD;AAClD,2DAA6D;AAI7D,mFAAgF;AAChF,6DAA+D;AAE/D,MAAM,WAAW,GAAG,QAAQ,CAAC;AAU7B;;;;;;GAMG;AACI,KAAK,UAAU,YAAY;IAChC,IAAI,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE;QACrB,OAAO,OAAO,CAA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AAM;QACL,OAAO,IAAI,6BAAoB,CAAC,KAAK,CAAC,CAAC;KACxC;AACH,CAAC;AATD,kEASC;AAED,SAAgB,qBAAqB,CAAC,MAAc;IAClD,MAAM,KAAK,GAAG,2DAA2D,CAAC;IAC1E,MAAM,MAAM,GAAiB,EAAE,CAAC;IAChC,IAAI,KAAK,CAAC;IACV,OAAO,CAAC,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE;QACnC,IAAI,KAAK,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;YAC/B,MAAM,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;YAC5B,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;YAC9B,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;SACrB;KACF;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAZD,sDAYC;AAED,SAAgB,qBAAqB,CAAC,GAAW;IAC/C,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACpD,CAAC;AAFD,sDAEC"}
|
|
@@ -4,10 +4,12 @@ import { AppDefinition } from "../../../driver/teamsApp/interfaces/appdefinition
|
|
|
4
4
|
import { AppUser } from "../../../driver/teamsApp/interfaces/appdefinitions/appUser";
|
|
5
5
|
import { IPublishingAppDenition } from "../interfaces/appdefinitions/IPublishingAppDefinition";
|
|
6
6
|
import { IValidationResult } from "../../../driver/teamsApp/interfaces/appdefinitions/IValidationResult";
|
|
7
|
-
import { ApiSecretRegistration } from "../interfaces/ApiSecretRegistration";
|
|
7
|
+
import { ApiSecretRegistration, ApiSecretRegistrationUpdate } from "../interfaces/ApiSecretRegistration";
|
|
8
8
|
import { AsyncAppValidationResponse } from "../interfaces/AsyncAppValidationResponse";
|
|
9
9
|
import { AsyncAppValidationResultsResponse } from "../interfaces/AsyncAppValidationResultsResponse";
|
|
10
10
|
import { AsyncAppValidationDetailsResponse } from "../interfaces/AsyncAppValidationDetailsResponse";
|
|
11
|
+
import { OauthRegistration } from "../interfaces/OauthRegistration";
|
|
12
|
+
import { OauthConfigurationId } from "../interfaces/OauthConfigurationId";
|
|
11
13
|
export declare namespace AppStudioClient {
|
|
12
14
|
/**
|
|
13
15
|
* Set user region
|
|
@@ -73,9 +75,10 @@ export declare namespace AppStudioClient {
|
|
|
73
75
|
* Submit App Validation Request (In-App) for which App Definitions are stored at TDP.
|
|
74
76
|
* @param teamsAppId
|
|
75
77
|
* @param appStudioToken
|
|
78
|
+
* @param timeoutSeconds
|
|
76
79
|
* @returns
|
|
77
80
|
*/
|
|
78
|
-
function submitAppValidationRequest(teamsAppId: string, appStudioToken: string): Promise<AsyncAppValidationResponse>;
|
|
81
|
+
function submitAppValidationRequest(teamsAppId: string, appStudioToken: string, timeoutSeconds?: number): Promise<AsyncAppValidationResponse>;
|
|
79
82
|
/**
|
|
80
83
|
* Get App validation requests sumitted by the user
|
|
81
84
|
* @param teamsAppId
|
|
@@ -87,9 +90,10 @@ export declare namespace AppStudioClient {
|
|
|
87
90
|
* Get App validation results by provided app validation id
|
|
88
91
|
* @param appValidationId
|
|
89
92
|
* @param appStudioToken
|
|
93
|
+
* @param timeoutSeconds
|
|
90
94
|
* @returns
|
|
91
95
|
*/
|
|
92
|
-
function getAppValidationById(appValidationId: string, appStudioToken: string): Promise<AsyncAppValidationResultsResponse>;
|
|
96
|
+
function getAppValidationById(appValidationId: string, appStudioToken: string, timeoutSeconds?: number): Promise<AsyncAppValidationResultsResponse>;
|
|
93
97
|
function getSideloadingStatus(appStudioToken: string): Promise<boolean | undefined>;
|
|
94
98
|
/**
|
|
95
99
|
* Create the Api Key registration.
|
|
@@ -103,5 +107,9 @@ export declare namespace AppStudioClient {
|
|
|
103
107
|
* @param apiSecretRegistrationId
|
|
104
108
|
*/
|
|
105
109
|
function getApiKeyRegistrationById(appStudioToken: string, apiSecretRegistrationId: string): Promise<ApiSecretRegistration>;
|
|
110
|
+
function updateApiKeyRegistration(appStudioToken: string, apiKeyRegistration: ApiSecretRegistrationUpdate, apiKeyRegistrationId: string): Promise<ApiSecretRegistrationUpdate>;
|
|
111
|
+
function getOauthRegistrationById(appStudioToken: string, oauthRegistrationId: string): Promise<OauthRegistration>;
|
|
112
|
+
function createOauthRegistration(appStudioToken: string, oauthRegistration: OauthRegistration): Promise<OauthConfigurationId>;
|
|
113
|
+
function updateOauthRegistration(appStudioToken: string, oauthRegistration: OauthRegistration, oauthRegistrationId: string): Promise<OauthRegistration>;
|
|
106
114
|
}
|
|
107
115
|
//# sourceMappingURL=appStudioClient.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appStudioClient.d.ts","sourceRoot":"","sources":["../../../../../src/component/driver/teamsApp/clients/appStudioClient.ts"],"names":[],"mappings":";AAQA,OAAO,EAAe,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,kEAAkE,CAAC;AACjG,OAAO,EAAE,OAAO,EAAE,MAAM,4DAA4D,CAAC;AAErF,OAAO,EAAE,sBAAsB,EAAE,MAAM,uDAAuD,CAAC;AAmB/F,OAAO,EAAE,iBAAiB,EAAE,MAAM,sEAAsE,CAAC;AAQzG,OAAO,
|
|
1
|
+
{"version":3,"file":"appStudioClient.d.ts","sourceRoot":"","sources":["../../../../../src/component/driver/teamsApp/clients/appStudioClient.ts"],"names":[],"mappings":";AAQA,OAAO,EAAe,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,kEAAkE,CAAC;AACjG,OAAO,EAAE,OAAO,EAAE,MAAM,4DAA4D,CAAC;AAErF,OAAO,EAAE,sBAAsB,EAAE,MAAM,uDAAuD,CAAC;AAmB/F,OAAO,EAAE,iBAAiB,EAAE,MAAM,sEAAsE,CAAC;A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App Definitions are stored at TDP.
|
|
509
509
|
* @param teamsAppId
|
|
510
510
|
* @param appStudioToken
|
|
511
|
+
* @param timeoutSeconds
|
|
511
512
|
* @returns
|
|
512
513
|
*/
|
|
513
|
-
async function submitAppValidationRequest(teamsAppId, appStudioToken) {
|
|
514
|
+
async function submitAppValidationRequest(teamsAppId, appStudioToken, timeoutSeconds = 10) {
|
|
514
515
|
const requester = createRequesterWithToken(appStudioToken, region);
|
|
516
|
+
requester.defaults.timeout = timeoutSeconds * 1000;
|
|
515
517
|
try {
|
|
516
518
|
const response = await utils_1.RetryHandler.Retry(() => requester.post(`/api/v1.0/appvalidations/appdefinition/validate`, {
|
|
517
519
|
AppEnvironmentId: null,
|
|
@@ -547,10 +549,12 @@ var AppStudioClient;
|
|
|
547
549
|
* Get App validation results by provided app validation id
|
|
548
550
|
* @param appValidationId
|
|
549
551
|
* @param appStudioToken
|
|
552
|
+
* @param timeoutSeconds
|
|
550
553
|
* @returns
|
|
551
554
|
*/
|
|
552
|
-
async function getAppValidationById(appValidationId, appStudioToken) {
|
|
555
|
+
async function getAppValidationById(appValidationId, appStudioToken, timeoutSeconds = 10) {
|
|
553
556
|
const requester = createRequesterWithToken(appStudioToken, region);
|
|
557
|
+
requester.defaults.timeout = timeoutSeconds * 1000;
|
|
554
558
|
try {
|
|
555
559
|
const response = await utils_1.RetryHandler.Retry(() => requester.get(`/api/v1.0/appvalidations/${appValidationId}`));
|
|
556
560
|
return response === null || response === void 0 ? void 0 : response.data;
|
|
@@ -656,5 +660,53 @@ var AppStudioClient;
|
|
|
656
660
|
}
|
|
657
661
|
}
|
|
658
662
|
AppStudioClient.getApiKeyRegistrationById = getApiKeyRegistrationById;
|
|
663
|
+
async function updateApiKeyRegistration(appStudioToken, apiKeyRegistration, apiKeyRegistrationId) {
|
|
664
|
+
const requester = createRequesterWithToken(appStudioToken);
|
|
665
|
+
try {
|
|
666
|
+
const response = await utils_1.RetryHandler.Retry(() => requester.patch(`/api/v1.0/apiSecretRegistrations/${apiKeyRegistrationId}`, apiKeyRegistration));
|
|
667
|
+
return response === null || response === void 0 ? void 0 : response.data;
|
|
668
|
+
}
|
|
669
|
+
catch (e) {
|
|
670
|
+
const error = wrapException(e, constants_1.APP_STUDIO_API_NAMES.UPDATE_API_KEY);
|
|
671
|
+
throw error;
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
AppStudioClient.updateApiKeyRegistration = updateApiKeyRegistration;
|
|
675
|
+
async function getOauthRegistrationById(appStudioToken, oauthRegistrationId) {
|
|
676
|
+
const requester = createRequesterWithToken(appStudioToken);
|
|
677
|
+
try {
|
|
678
|
+
const response = await utils_1.RetryHandler.Retry(() => requester.get(`/api/v1.0/oAuthConfigurations/${oauthRegistrationId}`));
|
|
679
|
+
return response === null || response === void 0 ? void 0 : response.data;
|
|
680
|
+
}
|
|
681
|
+
catch (e) {
|
|
682
|
+
const error = wrapException(e, constants_1.APP_STUDIO_API_NAMES.GET_OAUTH);
|
|
683
|
+
throw error;
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
AppStudioClient.getOauthRegistrationById = getOauthRegistrationById;
|
|
687
|
+
async function createOauthRegistration(appStudioToken, oauthRegistration) {
|
|
688
|
+
const requester = createRequesterWithToken(appStudioToken);
|
|
689
|
+
try {
|
|
690
|
+
const response = await utils_1.RetryHandler.Retry(() => requester.post("/api/v1.0/oAuthConfigurations", oauthRegistration));
|
|
691
|
+
return response === null || response === void 0 ? void 0 : response.data;
|
|
692
|
+
}
|
|
693
|
+
catch (e) {
|
|
694
|
+
const error = wrapException(e, constants_1.APP_STUDIO_API_NAMES.CREATE_OAUTH);
|
|
695
|
+
throw error;
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
AppStudioClient.createOauthRegistration = createOauthRegistration;
|
|
699
|
+
async function updateOauthRegistration(appStudioToken, oauthRegistration, oauthRegistrationId) {
|
|
700
|
+
const requester = createRequesterWithToken(appStudioToken);
|
|
701
|
+
try {
|
|
702
|
+
const response = await utils_1.RetryHandler.Retry(() => requester.patch(`/api/v1.0/oAuthConfigurations/${oauthRegistrationId}`, oauthRegistration));
|
|
703
|
+
return response === null || response === void 0 ? void 0 : response.data;
|
|
704
|
+
}
|
|
705
|
+
catch (e) {
|
|
706
|
+
const error = wrapException(e, constants_1.APP_STUDIO_API_NAMES.UPDATE_OAUTH);
|
|
707
|
+
throw error;
|
|
708
|
+
}
|
|
709
|
+
}
|
|
710
|
+
AppStudioClient.updateOauthRegistration = updateOauthRegistration;
|
|
659
711
|
})(AppStudioClient = exports.AppStudioClient || (exports.AppStudioClient = {}));
|
|
660
712
|
//# sourceMappingURL=appStudioClient.js.map
|