@microsoft/teamsfx-core 2.0.8 → 2.0.9-alpha.20d61baa8.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/azureUtils.d.ts +3 -0
- package/build/common/azureUtils.d.ts.map +1 -0
- package/build/common/azureUtils.js +50 -0
- package/build/common/azureUtils.js.map +1 -0
- package/build/common/constants.d.ts +8 -0
- package/build/common/constants.d.ts.map +1 -1
- package/build/common/constants.js +32 -1
- package/build/common/constants.js.map +1 -1
- package/build/common/globalState.js +3 -3
- package/build/common/local/taskDefinition.js +3 -3
- package/build/common/local/taskDefinition.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 +10 -10
- package/build/common/m365/launchHelper.js.map +1 -1
- package/build/common/m365/packageService.d.ts.map +1 -1
- package/build/common/m365/packageService.js +9 -9
- package/build/common/m365/packageService.js.map +1 -1
- package/build/common/requestUtils.d.ts +4 -0
- package/build/common/requestUtils.d.ts.map +1 -0
- package/build/common/requestUtils.js +52 -0
- package/build/common/requestUtils.js.map +1 -0
- package/build/common/samples.d.ts +6 -1
- package/build/common/samples.d.ts.map +1 -1
- package/build/common/samples.js +3 -3
- package/build/common/samples.js.map +1 -1
- package/build/common/stringUtils.d.ts +5 -0
- package/build/common/stringUtils.d.ts.map +1 -1
- package/build/common/stringUtils.js +42 -1
- package/build/common/stringUtils.js.map +1 -1
- package/build/common/templates-config.json +2 -2
- package/build/common/tools.d.ts +1 -21
- package/build/common/tools.d.ts.map +1 -1
- package/build/common/tools.js +6 -190
- package/build/common/tools.js.map +1 -1
- package/build/common/utils.d.ts +1 -1
- package/build/common/utils.d.ts.map +1 -1
- package/build/common/utils.js +5 -5
- package/build/common/utils.js.map +1 -1
- package/build/component/configManager/validator.js +1 -1
- package/build/component/configManager/validator.js.map +1 -1
- package/build/component/constants.d.ts +3 -3
- package/build/component/constants.d.ts.map +1 -1
- package/build/component/constants.js +3 -3
- package/build/component/constants.js.map +1 -1
- package/build/component/coordinator/index.d.ts.map +1 -1
- package/build/component/coordinator/index.js +61 -59
- package/build/component/coordinator/index.js.map +1 -1
- package/build/component/developerPortalScaffoldUtils.d.ts +0 -5
- package/build/component/developerPortalScaffoldUtils.d.ts.map +1 -1
- package/build/component/developerPortalScaffoldUtils.js +23 -52
- package/build/component/developerPortalScaffoldUtils.js.map +1 -1
- package/build/component/driver/aad/create.d.ts.map +1 -1
- package/build/component/driver/aad/create.js +17 -18
- package/build/component/driver/aad/create.js.map +1 -1
- package/build/component/driver/aad/utility/aadAppClient.d.ts.map +1 -1
- package/build/component/driver/aad/utility/aadAppClient.js +9 -9
- package/build/component/driver/aad/utility/aadAppClient.js.map +1 -1
- package/build/component/driver/aad/utility/buildAadManifest.d.ts +1 -1
- package/build/component/driver/aad/utility/buildAadManifest.d.ts.map +1 -1
- package/build/component/driver/aad/utility/buildAadManifest.js +11 -11
- package/build/component/driver/aad/utility/buildAadManifest.js.map +1 -1
- package/build/component/driver/add/addWebPart.d.ts +2 -2
- package/build/component/driver/add/addWebPart.d.ts.map +1 -1
- package/build/component/driver/add/addWebPart.js +27 -27
- package/build/component/driver/add/addWebPart.js.map +1 -1
- package/build/component/driver/apiKey/create.d.ts.map +1 -1
- package/build/component/driver/apiKey/create.js +14 -13
- package/build/component/driver/apiKey/create.js.map +1 -1
- package/build/component/driver/arm/util/bicepChecker.d.ts.map +1 -1
- package/build/component/driver/arm/util/bicepChecker.js +20 -2
- package/build/component/driver/arm/util/bicepChecker.js.map +1 -1
- package/build/component/driver/arm/util/handleError.js +2 -2
- package/build/component/driver/arm/util/handleError.js.map +1 -1
- package/build/component/driver/deploy/azure/impl/azureDeployImpl.d.ts +4 -4
- package/build/component/driver/deploy/azure/impl/azureDeployImpl.d.ts.map +1 -1
- package/build/component/driver/deploy/azure/impl/azureDeployImpl.js +13 -13
- package/build/component/driver/deploy/azure/impl/azureDeployImpl.js.map +1 -1
- package/build/component/driver/deploy/spfx/deployDriver.d.ts +1 -1
- package/build/component/driver/deploy/spfx/deployDriver.d.ts.map +1 -1
- package/build/component/driver/deploy/spfx/deployDriver.js +19 -18
- package/build/component/driver/deploy/spfx/deployDriver.js.map +1 -1
- package/build/component/driver/oauth/create.d.ts +1 -1
- package/build/component/driver/oauth/create.d.ts.map +1 -1
- package/build/component/driver/oauth/create.js +21 -21
- package/build/component/driver/oauth/create.js.map +1 -1
- package/build/component/driver/teamsApp/appStudio.d.ts +1 -1
- package/build/component/driver/teamsApp/appStudio.d.ts.map +1 -1
- package/build/component/driver/teamsApp/appStudio.js +19 -20
- package/build/component/driver/teamsApp/appStudio.js.map +1 -1
- package/build/component/driver/teamsApp/clients/appStudioClient.js +4 -4
- package/build/component/driver/teamsApp/configure.d.ts +1 -1
- package/build/component/driver/teamsApp/configure.d.ts.map +1 -1
- package/build/component/driver/teamsApp/configure.js +13 -13
- package/build/component/driver/teamsApp/configure.js.map +1 -1
- package/build/component/driver/teamsApp/create.js +1 -2
- package/build/component/driver/teamsApp/create.js.map +1 -1
- package/build/component/driver/teamsApp/publishAppPackage.d.ts +1 -1
- package/build/component/driver/teamsApp/publishAppPackage.d.ts.map +1 -1
- package/build/component/driver/teamsApp/publishAppPackage.js +13 -14
- package/build/component/driver/teamsApp/publishAppPackage.js.map +1 -1
- package/build/component/driver/teamsApp/teamsappMgr.d.ts.map +1 -1
- package/build/component/driver/teamsApp/teamsappMgr.js +2 -3
- package/build/component/driver/teamsApp/teamsappMgr.js.map +1 -1
- package/build/component/driver/teamsApp/utils/ManifestUtils.d.ts.map +1 -1
- package/build/component/driver/teamsApp/utils/ManifestUtils.js +32 -32
- package/build/component/driver/teamsApp/utils/ManifestUtils.js.map +1 -1
- package/build/component/driver/teamsApp/utils/utils.d.ts.map +1 -1
- package/build/component/driver/teamsApp/utils/utils.js.map +1 -1
- package/build/component/driver/teamsApp/validateAppPackage.d.ts +2 -5
- package/build/component/driver/teamsApp/validateAppPackage.d.ts.map +1 -1
- package/build/component/driver/teamsApp/validateAppPackage.js +14 -15
- package/build/component/driver/teamsApp/validateAppPackage.js.map +1 -1
- package/build/component/driver/teamsApp/validateTestCases.d.ts.map +1 -1
- package/build/component/driver/teamsApp/validateTestCases.js +3 -3
- package/build/component/driver/teamsApp/validateTestCases.js.map +1 -1
- package/build/component/driver/util/utils.d.ts +3 -0
- package/build/component/driver/util/utils.d.ts.map +1 -1
- package/build/component/driver/util/utils.js +16 -1
- package/build/component/driver/util/utils.js.map +1 -1
- package/build/component/generator/copilotPlugin/generator.d.ts +10 -1
- package/build/component/generator/copilotPlugin/generator.d.ts.map +1 -1
- package/build/component/generator/copilotPlugin/generator.js +234 -83
- 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 +37 -24
- package/build/component/generator/copilotPlugin/helper.js.map +1 -1
- package/build/component/generator/generator.d.ts.map +1 -1
- package/build/component/generator/generator.js +7 -7
- package/build/component/generator/generator.js.map +1 -1
- package/build/component/generator/generatorAction.d.ts +1 -1
- package/build/component/generator/generatorAction.d.ts.map +1 -1
- package/build/component/generator/generatorAction.js.map +1 -1
- package/build/component/generator/generatorProvider.d.ts.map +1 -1
- package/build/component/generator/generatorProvider.js +6 -2
- package/build/component/generator/generatorProvider.js.map +1 -1
- package/build/component/generator/officeAddin/generator.d.ts +2 -2
- package/build/component/generator/officeAddin/generator.d.ts.map +1 -1
- package/build/component/generator/officeAddin/generator.js +37 -36
- package/build/component/generator/officeAddin/generator.js.map +1 -1
- package/build/component/generator/officeAddin/helperMethods.d.ts +5 -0
- package/build/component/generator/officeAddin/helperMethods.d.ts.map +1 -1
- package/build/component/generator/officeAddin/helperMethods.js +37 -0
- package/build/component/generator/officeAddin/helperMethods.js.map +1 -1
- package/build/component/generator/officeXMLAddin/generator.d.ts +9 -1
- package/build/component/generator/officeXMLAddin/generator.d.ts.map +1 -1
- package/build/component/generator/officeXMLAddin/generator.js +74 -11
- package/build/component/generator/officeXMLAddin/generator.js.map +1 -1
- package/build/component/generator/officeXMLAddin/projectConfig.d.ts +2 -4
- package/build/component/generator/officeXMLAddin/projectConfig.d.ts.map +1 -1
- package/build/component/generator/officeXMLAddin/projectConfig.js +1 -11
- package/build/component/generator/officeXMLAddin/projectConfig.js.map +1 -1
- package/build/component/generator/spfx/spfxGenerator.d.ts +2 -2
- package/build/component/generator/spfx/spfxGenerator.d.ts.map +1 -1
- package/build/component/generator/spfx/spfxGenerator.js +54 -55
- package/build/component/generator/spfx/spfxGenerator.js.map +1 -1
- package/build/component/generator/templates/ssrTabGenerator.d.ts.map +1 -1
- package/build/component/generator/templates/ssrTabGenerator.js +5 -5
- package/build/component/generator/templates/ssrTabGenerator.js.map +1 -1
- package/build/component/generator/templates/templateGenerator.d.ts +3 -3
- package/build/component/generator/templates/templateGenerator.d.ts.map +1 -1
- package/build/component/generator/templates/templateGenerator.js +4 -6
- package/build/component/generator/templates/templateGenerator.js.map +1 -1
- package/build/component/generator/templates/templateNames.js +108 -109
- package/build/component/generator/templates/templateNames.js.map +1 -1
- package/build/component/generator/templates/templateReplaceMap.js +9 -9
- package/build/component/generator/templates/templateReplaceMap.js.map +1 -1
- package/build/component/generator/utils.d.ts +1 -10
- package/build/component/generator/utils.d.ts.map +1 -1
- package/build/component/generator/utils.js +18 -61
- package/build/component/generator/utils.js.map +1 -1
- package/build/component/middleware/envMW.js +2 -2
- package/build/component/middleware/envMW.js.map +1 -1
- package/build/component/migrate.d.ts +8 -0
- package/build/component/migrate.d.ts.map +1 -1
- package/build/component/migrate.js +62 -8
- package/build/component/migrate.js.map +1 -1
- package/build/component/provisionUtils.js +2 -2
- package/build/component/provisionUtils.js.map +1 -1
- package/build/component/resource/botService/botRegistration/botFrameworkRegistration.d.ts +1 -1
- package/build/component/resource/botService/botRegistration/botFrameworkRegistration.d.ts.map +1 -1
- package/build/component/resource/botService/botRegistration/botFrameworkRegistration.js +5 -2
- package/build/component/resource/botService/botRegistration/botFrameworkRegistration.js.map +1 -1
- package/build/component/utils/ResourceGroupHelper.d.ts +10 -2
- package/build/component/utils/ResourceGroupHelper.d.ts.map +1 -1
- package/build/component/utils/ResourceGroupHelper.js +134 -41
- package/build/component/utils/ResourceGroupHelper.js.map +1 -1
- package/build/component/utils.d.ts +1 -10
- package/build/component/utils.d.ts.map +1 -1
- package/build/component/utils.js +1 -120
- package/build/component/utils.js.map +1 -1
- package/build/core/FxCore.d.ts +2 -2
- package/build/core/FxCore.d.ts.map +1 -1
- package/build/core/FxCore.js +57 -56
- package/build/core/FxCore.js.map +1 -1
- package/build/core/callback.d.ts +2 -2
- package/build/core/callback.d.ts.map +1 -1
- package/build/core/callback.js.map +1 -1
- package/build/core/collaborator.js +19 -19
- package/build/core/collaborator.js.map +1 -1
- package/build/core/middleware/concurrentLocker.js +7 -7
- package/build/core/middleware/concurrentLocker.js.map +1 -1
- package/build/core/middleware/projectMigratorV3.d.ts +1 -0
- package/build/core/middleware/projectMigratorV3.d.ts.map +1 -1
- package/build/core/middleware/projectMigratorV3.js +11 -3
- package/build/core/middleware/projectMigratorV3.js.map +1 -1
- package/build/core/middleware/utils/appYmlGenerator.d.ts +1 -0
- package/build/core/middleware/utils/appYmlGenerator.d.ts.map +1 -1
- package/build/core/middleware/utils/appYmlGenerator.js +10 -3
- package/build/core/middleware/utils/appYmlGenerator.js.map +1 -1
- package/build/core/middleware/videoFilterAppBlocker.d.ts +2 -0
- package/build/core/middleware/videoFilterAppBlocker.d.ts.map +1 -1
- package/build/core/middleware/videoFilterAppBlocker.js +20 -3
- package/build/core/middleware/videoFilterAppBlocker.js.map +1 -1
- package/build/error/common.d.ts +1 -0
- package/build/error/common.d.ts.map +1 -1
- package/build/error/common.js +9 -1
- package/build/error/common.js.map +1 -1
- package/build/index.d.ts +30 -21
- package/build/index.d.ts.map +1 -1
- package/build/index.js +41 -32
- package/build/index.js.map +1 -1
- package/build/question/constants.d.ts +249 -0
- package/build/question/constants.d.ts.map +1 -1
- package/build/question/constants.js +1090 -1
- package/build/question/constants.js.map +1 -1
- package/build/question/create.d.ts +9 -147
- package/build/question/create.d.ts.map +1 -1
- package/build/question/create.js +264 -1145
- package/build/question/create.js.map +1 -1
- package/build/question/index.d.ts +1 -3
- package/build/question/index.d.ts.map +1 -1
- package/build/question/index.js +2 -6
- package/build/question/index.js.map +1 -1
- package/build/question/other.d.ts +2 -28
- package/build/question/other.d.ts.map +1 -1
- package/build/question/other.js +65 -270
- package/build/question/other.js.map +1 -1
- package/package.json +5 -4
- package/resource/package.nls.json +4 -3
- package/resource/yaml-schema/v1.6/yaml.schema.json +1829 -0
- package/resource/yaml-schema/yaml.schema.json +46 -1
- package/templates/core/v3Migration/js.ts.app.local.yml +3 -3
- 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/templates/plugins/resource/aad/auth/V3/aad.manifest.template.json +6 -0
- package/templates/plugins/resource/aad/manifest/aad.template.json +6 -0
- package/templates/plugins/resource/aad/manifest/bot/aad.manifest.template.json +6 -0
- package/templates/plugins/resource/aad/manifest/tab/aad.manifest.template.json +6 -0
- package/build/common/projectSettingsHelperV3.d.ts +0 -2
- package/build/common/projectSettingsHelperV3.d.ts.map +0 -1
- package/build/common/projectSettingsHelperV3.js +0 -15
- package/build/common/projectSettingsHelperV3.js.map +0 -1
- package/build/component/workflow.d.ts +0 -4
- package/build/component/workflow.d.ts.map +0 -1
- package/build/component/workflow.js +0 -18
- package/build/component/workflow.js.map +0 -1
- package/build/question/questionNames.d.ts +0 -78
- package/build/question/questionNames.d.ts.map +0 -1
- package/build/question/questionNames.js +0 -85
- package/build/question/questionNames.js.map +0 -1
package/build/question/other.js
CHANGED
|
@@ -2,39 +2,38 @@
|
|
|
2
2
|
// Copyright (c) Microsoft Corporation.
|
|
3
3
|
// Licensed under the MIT license.
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.oauthQuestion = exports.apiSpecApiKeyQuestion = exports.apiSpecApiKeyConfirmQestion = exports.addPluginQuestionNode = exports.selectPluginAvailabilityQuestion = exports.
|
|
5
|
+
exports.oauthQuestion = exports.apiSpecApiKeyQuestion = exports.apiSpecApiKeyConfirmQestion = exports.addPluginQuestionNode = exports.selectPluginAvailabilityQuestion = exports.createNewEnvQuestionNode = exports.selectSourceEnvQuestion = exports.newTargetEnvQuestion = exports.newEnvNameValidation = exports.envQuestionCondition = exports.selectAadManifestQuestion = exports.isAadMainifestContainsPlaceholder = exports.inputUserEmailQuestion = exports.selectTargetEnvQuestion = exports.previewWithTeamsAppManifestQuestionNode = exports.selectTeamsAppPackageQuestionNode = exports.copilotPluginAddAPIQuestionNode = exports.selectLocalTeamsAppManifestQuestion = exports.selectTeamsAppManifestQuestion = exports.addWebPartQuestionNode = exports.selectAadAppManifestQuestionNode = exports.selectTeamsAppManifestQuestionNode = exports.validateTeamsAppQuestionNode = exports.deployAadManifestQuestionNode = exports.grantPermissionQuestionNode = exports.listCollaboratorQuestionNode = void 0;
|
|
6
6
|
const tslib_1 = require("tslib");
|
|
7
7
|
const teamsfx_api_1 = require("@microsoft/teamsfx-api");
|
|
8
8
|
const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
|
|
9
9
|
const path = tslib_1.__importStar(require("path"));
|
|
10
10
|
const constants_1 = require("../common/constants");
|
|
11
|
+
const featureFlags_1 = require("../common/featureFlags");
|
|
11
12
|
const localizeUtils_1 = require("../common/localizeUtils");
|
|
12
|
-
const tools_1 = require("../common/tools");
|
|
13
13
|
const constants_2 = require("../component/driver/add/utility/constants");
|
|
14
|
-
const
|
|
14
|
+
const constants_3 = require("../component/driver/teamsApp/constants");
|
|
15
|
+
const errors_1 = require("../component/driver/teamsApp/errors");
|
|
16
|
+
const results_1 = require("../component/driver/teamsApp/results");
|
|
17
|
+
const ManifestUtils_1 = require("../component/driver/teamsApp/utils/ManifestUtils");
|
|
18
|
+
const common_1 = require("../component/utils/common");
|
|
15
19
|
const envUtil_1 = require("../component/utils/envUtil");
|
|
16
20
|
const collaborator_1 = require("../core/collaborator");
|
|
17
21
|
const environmentName_1 = require("../core/environmentName");
|
|
18
22
|
const globalVars_1 = require("../core/globalVars");
|
|
23
|
+
const constants_4 = require("./constants");
|
|
19
24
|
const create_1 = require("./create");
|
|
20
|
-
const questionNames_1 = require("./questionNames");
|
|
21
|
-
const featureFlags_1 = require("../common/featureFlags");
|
|
22
|
-
const common_1 = require("../component/utils/common");
|
|
23
|
-
const ManifestUtils_1 = require("../component/driver/teamsApp/utils/ManifestUtils");
|
|
24
|
-
const results_1 = require("../component/driver/teamsApp/results");
|
|
25
|
-
const errors_1 = require("../component/driver/teamsApp/errors");
|
|
26
25
|
function listCollaboratorQuestionNode() {
|
|
27
26
|
const selectTeamsAppNode = selectTeamsAppManifestQuestionNode();
|
|
28
27
|
selectTeamsAppNode.condition = { contains: collaborator_1.CollaborationConstants.TeamsAppQuestionId };
|
|
29
28
|
selectTeamsAppNode.children.push({
|
|
30
29
|
condition: envQuestionCondition,
|
|
31
|
-
data: selectTargetEnvQuestion(
|
|
30
|
+
data: selectTargetEnvQuestion(constants_4.QuestionNames.Env, false, false, ""),
|
|
32
31
|
});
|
|
33
32
|
const selectAadAppNode = selectAadAppManifestQuestionNode();
|
|
34
33
|
selectAadAppNode.condition = { contains: collaborator_1.CollaborationConstants.AadAppQuestionId };
|
|
35
34
|
selectAadAppNode.children.push({
|
|
36
35
|
condition: envQuestionCondition,
|
|
37
|
-
data: selectTargetEnvQuestion(
|
|
36
|
+
data: selectTargetEnvQuestion(constants_4.QuestionNames.Env, false, false, ""),
|
|
38
37
|
});
|
|
39
38
|
return {
|
|
40
39
|
data: { type: "group" },
|
|
@@ -55,13 +54,13 @@ function grantPermissionQuestionNode() {
|
|
|
55
54
|
selectTeamsAppNode.condition = { contains: collaborator_1.CollaborationConstants.TeamsAppQuestionId };
|
|
56
55
|
selectTeamsAppNode.children.push({
|
|
57
56
|
condition: envQuestionCondition,
|
|
58
|
-
data: selectTargetEnvQuestion(
|
|
57
|
+
data: selectTargetEnvQuestion(constants_4.QuestionNames.Env, false, false, ""),
|
|
59
58
|
});
|
|
60
59
|
const selectAadAppNode = selectAadAppManifestQuestionNode();
|
|
61
60
|
selectAadAppNode.condition = { contains: collaborator_1.CollaborationConstants.AadAppQuestionId };
|
|
62
61
|
selectAadAppNode.children.push({
|
|
63
62
|
condition: envQuestionCondition,
|
|
64
|
-
data: selectTargetEnvQuestion(
|
|
63
|
+
data: selectTargetEnvQuestion(constants_4.QuestionNames.Env, false, false, ""),
|
|
65
64
|
});
|
|
66
65
|
return {
|
|
67
66
|
data: { type: "group" },
|
|
@@ -94,7 +93,7 @@ function deployAadManifestQuestionNode() {
|
|
|
94
93
|
{
|
|
95
94
|
condition: (inputs) => inputs.platform === teamsfx_api_1.Platform.VSCode && // confirm question only works for VSC
|
|
96
95
|
inputs.projectPath !== undefined &&
|
|
97
|
-
path.resolve(inputs[
|
|
96
|
+
path.resolve(inputs[constants_4.QuestionNames.AadAppManifestFilePath]) !==
|
|
98
97
|
path.join(inputs.projectPath, "aad.manifest.json"),
|
|
99
98
|
data: confirmManifestQuestion(false, false),
|
|
100
99
|
cliOptionDisabled: "self",
|
|
@@ -102,7 +101,7 @@ function deployAadManifestQuestionNode() {
|
|
|
102
101
|
},
|
|
103
102
|
{
|
|
104
103
|
condition: isAadMainifestContainsPlaceholder,
|
|
105
|
-
data: selectTargetEnvQuestion(
|
|
104
|
+
data: selectTargetEnvQuestion(constants_4.QuestionNames.Env, false, false, ""),
|
|
106
105
|
},
|
|
107
106
|
],
|
|
108
107
|
},
|
|
@@ -117,15 +116,15 @@ function validateTeamsAppQuestionNode() {
|
|
|
117
116
|
inputsDisabled: "self",
|
|
118
117
|
children: [
|
|
119
118
|
{
|
|
120
|
-
condition: { equals: TeamsAppValidationOptions.schema().id },
|
|
119
|
+
condition: { equals: constants_4.TeamsAppValidationOptions.schema().id },
|
|
121
120
|
data: selectTeamsAppManifestQuestion(),
|
|
122
121
|
},
|
|
123
122
|
{
|
|
124
|
-
condition: { equals: TeamsAppValidationOptions.package().id },
|
|
123
|
+
condition: { equals: constants_4.TeamsAppValidationOptions.package().id },
|
|
125
124
|
data: selectTeamsAppPackageQuestion(),
|
|
126
125
|
},
|
|
127
126
|
{
|
|
128
|
-
condition: { equals: TeamsAppValidationOptions.testCases().id },
|
|
127
|
+
condition: { equals: constants_4.TeamsAppValidationOptions.testCases().id },
|
|
129
128
|
data: selectTeamsAppPackageQuestion(),
|
|
130
129
|
},
|
|
131
130
|
],
|
|
@@ -153,8 +152,8 @@ function selectAadAppManifestQuestionNode() {
|
|
|
153
152
|
{
|
|
154
153
|
condition: (inputs) => inputs.platform === teamsfx_api_1.Platform.VSCode && // confirm question only works for VSC
|
|
155
154
|
inputs.projectPath &&
|
|
156
|
-
inputs[
|
|
157
|
-
path.resolve(inputs[
|
|
155
|
+
inputs[constants_4.QuestionNames.AadAppManifestFilePath] &&
|
|
156
|
+
path.resolve(inputs[constants_4.QuestionNames.AadAppManifestFilePath]) !==
|
|
158
157
|
path.join(inputs.projectPath, "aad.manifest.json"),
|
|
159
158
|
data: confirmManifestQuestion(false, false),
|
|
160
159
|
cliOptionDisabled: "self",
|
|
@@ -167,17 +166,17 @@ exports.selectAadAppManifestQuestionNode = selectAadAppManifestQuestionNode;
|
|
|
167
166
|
function confirmCondition(inputs, isLocal) {
|
|
168
167
|
return (inputs.platform === teamsfx_api_1.Platform.VSCode && // confirm question only works for VSC
|
|
169
168
|
inputs.projectPath &&
|
|
170
|
-
inputs[isLocal ?
|
|
169
|
+
inputs[isLocal ? constants_4.QuestionNames.LocalTeamsAppManifestFilePath : constants_4.QuestionNames.TeamsAppManifestFilePath] &&
|
|
171
170
|
path.resolve(inputs[isLocal
|
|
172
|
-
?
|
|
173
|
-
:
|
|
171
|
+
? constants_4.QuestionNames.LocalTeamsAppManifestFilePath
|
|
172
|
+
: constants_4.QuestionNames.TeamsAppManifestFilePath]) !==
|
|
174
173
|
path.join(inputs.projectPath, teamsfx_api_1.AppPackageFolderName, isLocal ? "manifest.local.json" : "manifest.json"));
|
|
175
174
|
}
|
|
176
175
|
async function spfxFrameworkExist(inputs) {
|
|
177
176
|
if (inputs.platform === teamsfx_api_1.Platform.CLI_HELP) {
|
|
178
177
|
return false;
|
|
179
178
|
}
|
|
180
|
-
const yorcPath = path.join(inputs[
|
|
179
|
+
const yorcPath = path.join(inputs[constants_4.QuestionNames.SPFxFolder], constants_2.Constants.YO_RC_FILE);
|
|
181
180
|
if (!(await fs_extra_1.default.pathExists(yorcPath))) {
|
|
182
181
|
return false;
|
|
183
182
|
}
|
|
@@ -230,7 +229,7 @@ function addWebPartQuestionNode() {
|
|
|
230
229
|
exports.addWebPartQuestionNode = addWebPartQuestionNode;
|
|
231
230
|
function selectTeamsAppManifestQuestion() {
|
|
232
231
|
return {
|
|
233
|
-
name:
|
|
232
|
+
name: constants_4.QuestionNames.TeamsAppManifestFilePath,
|
|
234
233
|
cliName: "teams-manifest-file",
|
|
235
234
|
cliShortName: "t",
|
|
236
235
|
cliDescription: "Specify the path for Teams app manifest template. It can be either absolute path or relative path to the project root folder, with default at './appPackage/manifest.json'",
|
|
@@ -257,7 +256,7 @@ function selectTeamsAppManifestQuestion() {
|
|
|
257
256
|
exports.selectTeamsAppManifestQuestion = selectTeamsAppManifestQuestion;
|
|
258
257
|
function selectLocalTeamsAppManifestQuestion() {
|
|
259
258
|
return {
|
|
260
|
-
name:
|
|
259
|
+
name: constants_4.QuestionNames.LocalTeamsAppManifestFilePath,
|
|
261
260
|
cliName: "local-teams-manifest-file",
|
|
262
261
|
cliShortName: "l",
|
|
263
262
|
cliDescription: "Specifies the Microsoft Teams app manifest template file path for local environment, it can be either absolute path or relative path to project root folder.",
|
|
@@ -284,10 +283,10 @@ function selectLocalTeamsAppManifestQuestion() {
|
|
|
284
283
|
exports.selectLocalTeamsAppManifestQuestion = selectLocalTeamsAppManifestQuestion;
|
|
285
284
|
function confirmManifestQuestion(isTeamsApp = true, isLocal = false) {
|
|
286
285
|
const map = {
|
|
287
|
-
true_true:
|
|
288
|
-
true_false:
|
|
289
|
-
false_true:
|
|
290
|
-
false_false:
|
|
286
|
+
true_true: constants_4.QuestionNames.ConfirmLocalManifest,
|
|
287
|
+
true_false: constants_4.QuestionNames.ConfirmManifest,
|
|
288
|
+
false_true: constants_4.QuestionNames.ConfirmAadManifest,
|
|
289
|
+
false_false: constants_4.QuestionNames.ConfirmAadManifest,
|
|
291
290
|
};
|
|
292
291
|
const name = map[`${isTeamsApp.toString()}_${isLocal.toString()}`];
|
|
293
292
|
return {
|
|
@@ -307,26 +306,26 @@ function confirmManifestQuestion(isTeamsApp = true, isLocal = false) {
|
|
|
307
306
|
id: "manifest",
|
|
308
307
|
label: `$(file) ${path.basename(isTeamsApp
|
|
309
308
|
? inputs[isLocal
|
|
310
|
-
?
|
|
311
|
-
:
|
|
312
|
-
: inputs[
|
|
309
|
+
? constants_4.QuestionNames.LocalTeamsAppManifestFilePath
|
|
310
|
+
: constants_4.QuestionNames.TeamsAppManifestFilePath]
|
|
311
|
+
: inputs[constants_4.QuestionNames.AadAppManifestFilePath])}`,
|
|
313
312
|
description: path.dirname(isTeamsApp
|
|
314
313
|
? inputs[isLocal
|
|
315
|
-
?
|
|
316
|
-
:
|
|
317
|
-
: inputs[
|
|
314
|
+
? constants_4.QuestionNames.LocalTeamsAppManifestFilePath
|
|
315
|
+
: constants_4.QuestionNames.TeamsAppManifestFilePath]
|
|
316
|
+
: inputs[constants_4.QuestionNames.AadAppManifestFilePath]),
|
|
318
317
|
},
|
|
319
318
|
];
|
|
320
319
|
},
|
|
321
320
|
};
|
|
322
321
|
}
|
|
323
322
|
function selectTeamsAppValidationMethodQuestion() {
|
|
324
|
-
const options = [TeamsAppValidationOptions.schema(), TeamsAppValidationOptions.package()];
|
|
323
|
+
const options = [constants_4.TeamsAppValidationOptions.schema(), constants_4.TeamsAppValidationOptions.package()];
|
|
325
324
|
if (featureFlags_1.isAsyncAppValidationEnabled()) {
|
|
326
|
-
options.push(TeamsAppValidationOptions.testCases());
|
|
325
|
+
options.push(constants_4.TeamsAppValidationOptions.testCases());
|
|
327
326
|
}
|
|
328
327
|
return {
|
|
329
|
-
name:
|
|
328
|
+
name: constants_4.QuestionNames.ValidateMethod,
|
|
330
329
|
title: localizeUtils_1.getLocalizedString("core.selectValidateMethodQuestion.validate.selectTitle"),
|
|
331
330
|
staticOptions: options,
|
|
332
331
|
type: "singleSelect",
|
|
@@ -343,33 +342,9 @@ function copilotPluginAddAPIQuestionNode() {
|
|
|
343
342
|
};
|
|
344
343
|
}
|
|
345
344
|
exports.copilotPluginAddAPIQuestionNode = copilotPluginAddAPIQuestionNode;
|
|
346
|
-
class TeamsAppValidationOptions {
|
|
347
|
-
static schema() {
|
|
348
|
-
return {
|
|
349
|
-
id: "validateAgainstSchema",
|
|
350
|
-
label: localizeUtils_1.getLocalizedString("core.selectValidateMethodQuestion.validate.schemaOption"),
|
|
351
|
-
description: localizeUtils_1.getLocalizedString("core.selectValidateMethodQuestion.validate.schemaOptionDescription"),
|
|
352
|
-
};
|
|
353
|
-
}
|
|
354
|
-
static package() {
|
|
355
|
-
return {
|
|
356
|
-
id: "validateAgainstPackage",
|
|
357
|
-
label: localizeUtils_1.getLocalizedString("core.selectValidateMethodQuestion.validate.appPackageOption"),
|
|
358
|
-
description: localizeUtils_1.getLocalizedString("core.selectValidateMethodQuestion.validate.appPackageOptionDescription"),
|
|
359
|
-
};
|
|
360
|
-
}
|
|
361
|
-
static testCases() {
|
|
362
|
-
return {
|
|
363
|
-
id: "validateWithTestCases",
|
|
364
|
-
label: localizeUtils_1.getLocalizedString("core.selectValidateMethodQuestion.validate.testCasesOption"),
|
|
365
|
-
description: localizeUtils_1.getLocalizedString("core.selectValidateMethodQuestion.validate.testCasesOptionDescription"),
|
|
366
|
-
};
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
exports.TeamsAppValidationOptions = TeamsAppValidationOptions;
|
|
370
345
|
function selectTeamsAppPackageQuestion() {
|
|
371
346
|
return {
|
|
372
|
-
name:
|
|
347
|
+
name: constants_4.QuestionNames.TeamsAppPackageFilePath,
|
|
373
348
|
title: localizeUtils_1.getLocalizedString("core.selectTeamsAppPackageQuestion.title"),
|
|
374
349
|
cliDescription: "Specifies the zipped Microsoft Teams app package path, it's a relative path to project root folder, defaults to '${folder}/appPackage/build/appPackage.${env}.zip'",
|
|
375
350
|
cliName: "app-package-file",
|
|
@@ -394,45 +369,15 @@ function selectTeamsAppPackageQuestionNode() {
|
|
|
394
369
|
};
|
|
395
370
|
}
|
|
396
371
|
exports.selectTeamsAppPackageQuestionNode = selectTeamsAppPackageQuestionNode;
|
|
397
|
-
var HubTypes;
|
|
398
|
-
(function (HubTypes) {
|
|
399
|
-
HubTypes["teams"] = "teams";
|
|
400
|
-
HubTypes["outlook"] = "outlook";
|
|
401
|
-
HubTypes["office"] = "office";
|
|
402
|
-
})(HubTypes = exports.HubTypes || (exports.HubTypes = {}));
|
|
403
|
-
class HubOptions {
|
|
404
|
-
static teams() {
|
|
405
|
-
return {
|
|
406
|
-
id: "teams",
|
|
407
|
-
label: "Teams",
|
|
408
|
-
};
|
|
409
|
-
}
|
|
410
|
-
static outlook() {
|
|
411
|
-
return {
|
|
412
|
-
id: "outlook",
|
|
413
|
-
label: "Outlook",
|
|
414
|
-
};
|
|
415
|
-
}
|
|
416
|
-
static office() {
|
|
417
|
-
return {
|
|
418
|
-
id: "office",
|
|
419
|
-
label: "the Microsoft 365 app",
|
|
420
|
-
};
|
|
421
|
-
}
|
|
422
|
-
static all() {
|
|
423
|
-
return [this.teams(), this.outlook(), this.office()];
|
|
424
|
-
}
|
|
425
|
-
}
|
|
426
|
-
exports.HubOptions = HubOptions;
|
|
427
372
|
function selectM365HostQuestion() {
|
|
428
373
|
return {
|
|
429
|
-
name:
|
|
374
|
+
name: constants_4.QuestionNames.M365Host,
|
|
430
375
|
cliShortName: "m",
|
|
431
376
|
cliDescription: "Preview the application in Teams, Outlook or the Microsoft 365 app.",
|
|
432
377
|
title: localizeUtils_1.getLocalizedString("core.M365HostQuestion.title"),
|
|
433
|
-
default: HubOptions.teams().id,
|
|
378
|
+
default: constants_4.HubOptions.teams().id,
|
|
434
379
|
type: "singleSelect",
|
|
435
|
-
staticOptions: HubOptions.all(),
|
|
380
|
+
staticOptions: constants_4.HubOptions.all(),
|
|
436
381
|
placeholder: localizeUtils_1.getLocalizedString("core.M365HostQuestion.placeholder"),
|
|
437
382
|
};
|
|
438
383
|
}
|
|
@@ -448,7 +393,7 @@ function previewWithTeamsAppManifestQuestionNode() {
|
|
|
448
393
|
};
|
|
449
394
|
}
|
|
450
395
|
exports.previewWithTeamsAppManifestQuestionNode = previewWithTeamsAppManifestQuestionNode;
|
|
451
|
-
function selectTargetEnvQuestion(questionName =
|
|
396
|
+
function selectTargetEnvQuestion(questionName = constants_4.QuestionNames.TargetEnvName, remoteOnly = true, throwErrorIfNoEnv = false, defaultValueIfNoEnv = environmentName_1.environmentNameManager.getDefaultEnvName()) {
|
|
452
397
|
return {
|
|
453
398
|
type: "singleSelect",
|
|
454
399
|
name: questionName,
|
|
@@ -477,7 +422,7 @@ async function getDefaultUserEmail() {
|
|
|
477
422
|
if (!(globalVars_1.TOOLS === null || globalVars_1.TOOLS === void 0 ? void 0 : globalVars_1.TOOLS.tokenProvider.m365TokenProvider))
|
|
478
423
|
return undefined;
|
|
479
424
|
const jsonObjectRes = await globalVars_1.TOOLS.tokenProvider.m365TokenProvider.getJsonObject({
|
|
480
|
-
scopes:
|
|
425
|
+
scopes: constants_3.AppStudioScopes,
|
|
481
426
|
});
|
|
482
427
|
if (jsonObjectRes.isErr()) {
|
|
483
428
|
throw jsonObjectRes.error;
|
|
@@ -492,7 +437,7 @@ async function getDefaultUserEmail() {
|
|
|
492
437
|
}
|
|
493
438
|
function inputUserEmailQuestion() {
|
|
494
439
|
return {
|
|
495
|
-
name:
|
|
440
|
+
name: constants_4.QuestionNames.UserEmail,
|
|
496
441
|
type: "text",
|
|
497
442
|
title: localizeUtils_1.getLocalizedString("core.getUserEmailQuestion.title"),
|
|
498
443
|
cliDescription: "Email address of the collaborator.",
|
|
@@ -518,7 +463,7 @@ function inputUserEmailQuestion() {
|
|
|
518
463
|
}
|
|
519
464
|
exports.inputUserEmailQuestion = inputUserEmailQuestion;
|
|
520
465
|
async function isAadMainifestContainsPlaceholder(inputs) {
|
|
521
|
-
const aadManifestPath = inputs === null || inputs === void 0 ? void 0 : inputs[
|
|
466
|
+
const aadManifestPath = inputs === null || inputs === void 0 ? void 0 : inputs[constants_4.QuestionNames.AadAppManifestFilePath];
|
|
522
467
|
const placeholderRegex = /\$\{\{ *[a-zA-Z0-9_.-]* *\}\}/g;
|
|
523
468
|
const regexObj = new RegExp(placeholderRegex);
|
|
524
469
|
try {
|
|
@@ -538,7 +483,7 @@ async function isAadMainifestContainsPlaceholder(inputs) {
|
|
|
538
483
|
exports.isAadMainifestContainsPlaceholder = isAadMainifestContainsPlaceholder;
|
|
539
484
|
function selectAadManifestQuestion() {
|
|
540
485
|
return {
|
|
541
|
-
name:
|
|
486
|
+
name: constants_4.QuestionNames.AadAppManifestFilePath,
|
|
542
487
|
cliName: "entra-app-manifest-file",
|
|
543
488
|
cliShortName: "a",
|
|
544
489
|
cliDescription: "Specifies the Microsoft Entra app manifest file path, can be either absolute path or relative path to project root folder.",
|
|
@@ -565,7 +510,7 @@ function selectAadManifestQuestion() {
|
|
|
565
510
|
exports.selectAadManifestQuestion = selectAadManifestQuestion;
|
|
566
511
|
function selectAppTypeQuestion() {
|
|
567
512
|
return {
|
|
568
|
-
name:
|
|
513
|
+
name: constants_4.QuestionNames.collaborationAppType,
|
|
569
514
|
title: localizeUtils_1.getLocalizedString("core.selectCollaborationAppTypeQuestion.title"),
|
|
570
515
|
type: "multiSelect",
|
|
571
516
|
staticOptions: [
|
|
@@ -588,8 +533,8 @@ async function envQuestionCondition(inputs) {
|
|
|
588
533
|
const appType = inputs[collaborator_1.CollaborationConstants.AppType];
|
|
589
534
|
const requireAad = appType === null || appType === void 0 ? void 0 : appType.includes(collaborator_1.CollaborationConstants.AadAppQuestionId);
|
|
590
535
|
const requireTeams = appType === null || appType === void 0 ? void 0 : appType.includes(collaborator_1.CollaborationConstants.TeamsAppQuestionId);
|
|
591
|
-
const aadManifestPath = inputs[
|
|
592
|
-
const teamsManifestPath = inputs[
|
|
536
|
+
const aadManifestPath = inputs[constants_4.QuestionNames.AadAppManifestFilePath];
|
|
537
|
+
const teamsManifestPath = inputs[constants_4.QuestionNames.TeamsAppManifestFilePath];
|
|
593
538
|
// When both is selected, only show the question once at the end
|
|
594
539
|
if ((requireAad && !aadManifestPath) || (requireTeams && !teamsManifestPath)) {
|
|
595
540
|
return false;
|
|
@@ -651,7 +596,7 @@ exports.newEnvNameValidation = newEnvNameValidation;
|
|
|
651
596
|
function newTargetEnvQuestion() {
|
|
652
597
|
return {
|
|
653
598
|
type: "text",
|
|
654
|
-
name:
|
|
599
|
+
name: constants_4.QuestionNames.NewTargetEnvName,
|
|
655
600
|
cliName: "name",
|
|
656
601
|
cliDescription: "Specifies the new environment name.",
|
|
657
602
|
cliType: "argument",
|
|
@@ -680,7 +625,7 @@ exports.newTargetEnvQuestion = newTargetEnvQuestion;
|
|
|
680
625
|
function selectSourceEnvQuestion() {
|
|
681
626
|
return {
|
|
682
627
|
type: "singleSelect",
|
|
683
|
-
name:
|
|
628
|
+
name: constants_4.QuestionNames.SourceEnvName,
|
|
684
629
|
cliName: "env",
|
|
685
630
|
title: localizeUtils_1.getLocalizedString("core.QuestionSelectSourceEnvironment.title"),
|
|
686
631
|
cliDescription: "Specifies an existing environment name to copy from.",
|
|
@@ -715,165 +660,15 @@ function createNewEnvQuestionNode() {
|
|
|
715
660
|
};
|
|
716
661
|
}
|
|
717
662
|
exports.createNewEnvQuestionNode = createNewEnvQuestionNode;
|
|
718
|
-
exports.newResourceGroupOption = "+ New resource group";
|
|
719
|
-
/**
|
|
720
|
-
* select existing resource group or create new resource group
|
|
721
|
-
*/
|
|
722
|
-
function selectResourceGroupQuestion(azureAccountProvider, subscriptionId) {
|
|
723
|
-
return {
|
|
724
|
-
type: "singleSelect",
|
|
725
|
-
name: questionNames_1.QuestionNames.TargetResourceGroupName,
|
|
726
|
-
title: localizeUtils_1.getLocalizedString("core.QuestionSelectResourceGroup.title"),
|
|
727
|
-
staticOptions: [{ id: exports.newResourceGroupOption, label: exports.newResourceGroupOption }],
|
|
728
|
-
dynamicOptions: async (inputs) => {
|
|
729
|
-
const rmClient = await ResourceGroupHelper_1.resourceGroupHelper.createRmClient(azureAccountProvider, subscriptionId);
|
|
730
|
-
const listRgRes = await ResourceGroupHelper_1.resourceGroupHelper.listResourceGroups(rmClient);
|
|
731
|
-
if (listRgRes.isErr())
|
|
732
|
-
throw listRgRes.error;
|
|
733
|
-
const rgList = listRgRes.value;
|
|
734
|
-
const options = rgList.map((rg) => {
|
|
735
|
-
return {
|
|
736
|
-
id: rg[0],
|
|
737
|
-
label: rg[0],
|
|
738
|
-
description: rg[1],
|
|
739
|
-
};
|
|
740
|
-
});
|
|
741
|
-
const existingResourceGroupNames = rgList.map((rg) => rg[0]);
|
|
742
|
-
inputs.existingResourceGroupNames = existingResourceGroupNames; // cache existing resource group names for valiation usage
|
|
743
|
-
return [{ id: exports.newResourceGroupOption, label: exports.newResourceGroupOption }, ...options];
|
|
744
|
-
},
|
|
745
|
-
skipSingleOption: true,
|
|
746
|
-
returnObject: true,
|
|
747
|
-
forgetLastValue: true,
|
|
748
|
-
};
|
|
749
|
-
}
|
|
750
|
-
function validateResourceGroupName(input, inputs) {
|
|
751
|
-
const name = input;
|
|
752
|
-
// https://docs.microsoft.com/en-us/rest/api/resources/resource-groups/create-or-update#uri-parameters
|
|
753
|
-
const match = name.match(/^[-\w._()]+$/);
|
|
754
|
-
if (!match) {
|
|
755
|
-
return localizeUtils_1.getLocalizedString("core.QuestionNewResourceGroupName.validation");
|
|
756
|
-
}
|
|
757
|
-
// To avoid the issue in CLI that using async func for validation and filter will make users input answers twice,
|
|
758
|
-
// we check the existence of a resource group from the list rather than call the api directly for now.
|
|
759
|
-
// Bug: https://msazure.visualstudio.com/Microsoft%20Teams%20Extensibility/_workitems/edit/15066282
|
|
760
|
-
// GitHub issue: https://github.com/SBoudrias/Inquirer.js/issues/1136
|
|
761
|
-
if (inputs === null || inputs === void 0 ? void 0 : inputs.existingResourceGroupNames) {
|
|
762
|
-
const maybeExist = inputs.existingResourceGroupNames.findIndex((o) => o.toLowerCase() === input.toLowerCase()) >= 0;
|
|
763
|
-
if (maybeExist) {
|
|
764
|
-
return `resource group already exists: ${name}`;
|
|
765
|
-
}
|
|
766
|
-
}
|
|
767
|
-
return undefined;
|
|
768
|
-
}
|
|
769
|
-
exports.validateResourceGroupName = validateResourceGroupName;
|
|
770
|
-
function newResourceGroupNameQuestion(defaultResourceGroupName) {
|
|
771
|
-
return {
|
|
772
|
-
type: "text",
|
|
773
|
-
name: questionNames_1.QuestionNames.NewResourceGroupName,
|
|
774
|
-
title: localizeUtils_1.getLocalizedString("core.QuestionNewResourceGroupName.title"),
|
|
775
|
-
placeholder: localizeUtils_1.getLocalizedString("core.QuestionNewResourceGroupName.placeholder"),
|
|
776
|
-
// default resource group name will change with env name
|
|
777
|
-
forgetLastValue: true,
|
|
778
|
-
default: defaultResourceGroupName,
|
|
779
|
-
validation: {
|
|
780
|
-
validFunc: validateResourceGroupName,
|
|
781
|
-
},
|
|
782
|
-
};
|
|
783
|
-
}
|
|
784
|
-
exports.newResourceGroupNameQuestion = newResourceGroupNameQuestion;
|
|
785
|
-
function selectResourceGroupLocationQuestion(azureAccountProvider, subscriptionId) {
|
|
786
|
-
return {
|
|
787
|
-
type: "singleSelect",
|
|
788
|
-
name: questionNames_1.QuestionNames.NewResourceGroupLocation,
|
|
789
|
-
title: localizeUtils_1.getLocalizedString("core.QuestionNewResourceGroupLocation.title"),
|
|
790
|
-
staticOptions: [],
|
|
791
|
-
dynamicOptions: async (inputs) => {
|
|
792
|
-
const rmClient = await ResourceGroupHelper_1.resourceGroupHelper.createRmClient(azureAccountProvider, subscriptionId);
|
|
793
|
-
const getLocationsRes = await ResourceGroupHelper_1.resourceGroupHelper.getLocations(azureAccountProvider, rmClient);
|
|
794
|
-
if (getLocationsRes.isErr()) {
|
|
795
|
-
throw getLocationsRes.error;
|
|
796
|
-
}
|
|
797
|
-
const recommended = getLocationsRes.value.filter((location) => {
|
|
798
|
-
return ResourceGroupHelper_1.recommendedLocations.indexOf(location) >= 0;
|
|
799
|
-
});
|
|
800
|
-
const others = getLocationsRes.value.filter((location) => {
|
|
801
|
-
return ResourceGroupHelper_1.recommendedLocations.indexOf(location) < 0;
|
|
802
|
-
});
|
|
803
|
-
return [
|
|
804
|
-
...recommended.map((location) => {
|
|
805
|
-
return {
|
|
806
|
-
id: location,
|
|
807
|
-
label: location,
|
|
808
|
-
groupName: localizeUtils_1.getLocalizedString("core.QuestionNewResourceGroupLocation.group.recommended"),
|
|
809
|
-
};
|
|
810
|
-
}),
|
|
811
|
-
...others.map((location) => {
|
|
812
|
-
return {
|
|
813
|
-
id: location,
|
|
814
|
-
label: location,
|
|
815
|
-
groupName: localizeUtils_1.getLocalizedString("core.QuestionNewResourceGroupLocation.group.others"),
|
|
816
|
-
};
|
|
817
|
-
}),
|
|
818
|
-
];
|
|
819
|
-
},
|
|
820
|
-
default: "Central US",
|
|
821
|
-
};
|
|
822
|
-
}
|
|
823
|
-
function resourceGroupQuestionNode(azureAccountProvider, subscriptionId, defaultResourceGroupName) {
|
|
824
|
-
return {
|
|
825
|
-
data: selectResourceGroupQuestion(azureAccountProvider, subscriptionId),
|
|
826
|
-
children: [
|
|
827
|
-
{
|
|
828
|
-
condition: { equals: exports.newResourceGroupOption },
|
|
829
|
-
data: newResourceGroupNameQuestion(defaultResourceGroupName),
|
|
830
|
-
children: [
|
|
831
|
-
{
|
|
832
|
-
data: selectResourceGroupLocationQuestion(azureAccountProvider, subscriptionId),
|
|
833
|
-
},
|
|
834
|
-
],
|
|
835
|
-
},
|
|
836
|
-
],
|
|
837
|
-
};
|
|
838
|
-
}
|
|
839
|
-
exports.resourceGroupQuestionNode = resourceGroupQuestionNode;
|
|
840
|
-
class PluginAvailabilityOptions {
|
|
841
|
-
static action() {
|
|
842
|
-
return {
|
|
843
|
-
id: "action",
|
|
844
|
-
label: localizeUtils_1.getLocalizedString("core.pluginAvailability.declarativeCopilot"),
|
|
845
|
-
};
|
|
846
|
-
}
|
|
847
|
-
static copilotPlugin() {
|
|
848
|
-
return {
|
|
849
|
-
id: "copilot-plugin",
|
|
850
|
-
label: localizeUtils_1.getLocalizedString("core.pluginAvailability.copilotForM365"),
|
|
851
|
-
};
|
|
852
|
-
}
|
|
853
|
-
static copilotPluginAndAction() {
|
|
854
|
-
return {
|
|
855
|
-
id: "copilot-plugin-and-action",
|
|
856
|
-
label: localizeUtils_1.getLocalizedString("core.pluginAvailability.declarativeCopilotAndM365"),
|
|
857
|
-
};
|
|
858
|
-
}
|
|
859
|
-
static all() {
|
|
860
|
-
return [
|
|
861
|
-
PluginAvailabilityOptions.copilotPlugin(),
|
|
862
|
-
PluginAvailabilityOptions.action(),
|
|
863
|
-
PluginAvailabilityOptions.copilotPluginAndAction(),
|
|
864
|
-
];
|
|
865
|
-
}
|
|
866
|
-
}
|
|
867
|
-
exports.PluginAvailabilityOptions = PluginAvailabilityOptions;
|
|
868
663
|
function selectPluginAvailabilityQuestion() {
|
|
869
664
|
return {
|
|
870
|
-
name:
|
|
665
|
+
name: constants_4.QuestionNames.PluginAvailability,
|
|
871
666
|
title: localizeUtils_1.getLocalizedString("core.question.pluginAvailability.title"),
|
|
872
667
|
cliDescription: "Select plugin availability.",
|
|
873
668
|
type: "singleSelect",
|
|
874
|
-
staticOptions: PluginAvailabilityOptions.all(),
|
|
669
|
+
staticOptions: constants_4.PluginAvailabilityOptions.all(),
|
|
875
670
|
dynamicOptions: async (inputs) => {
|
|
876
|
-
const teamsManifestPath = inputs[
|
|
671
|
+
const teamsManifestPath = inputs[constants_4.QuestionNames.TeamsAppManifestFilePath];
|
|
877
672
|
const absolutePath = common_1.getAbsolutePath(teamsManifestPath, inputs.projectPath);
|
|
878
673
|
const manifestRes = await ManifestUtils_1.manifestUtils._readAppManifest(absolutePath);
|
|
879
674
|
if (manifestRes.isErr()) {
|
|
@@ -885,10 +680,10 @@ function selectPluginAvailabilityQuestion() {
|
|
|
885
680
|
}
|
|
886
681
|
if (commonProperties.capabilities.includes("plugin")) {
|
|
887
682
|
// A project can have only one plugin.
|
|
888
|
-
return [PluginAvailabilityOptions.action()];
|
|
683
|
+
return [constants_4.PluginAvailabilityOptions.action()];
|
|
889
684
|
}
|
|
890
685
|
else {
|
|
891
|
-
return PluginAvailabilityOptions.all();
|
|
686
|
+
return constants_4.PluginAvailabilityOptions.all();
|
|
892
687
|
}
|
|
893
688
|
},
|
|
894
689
|
};
|
|
@@ -914,7 +709,7 @@ function addPluginQuestionNode() {
|
|
|
914
709
|
exports.addPluginQuestionNode = addPluginQuestionNode;
|
|
915
710
|
function apiSpecApiKeyConfirmQestion() {
|
|
916
711
|
return {
|
|
917
|
-
name:
|
|
712
|
+
name: constants_4.QuestionNames.ApiSpecApiKeyConfirm,
|
|
918
713
|
title: localizeUtils_1.getLocalizedString("core.createProjectQuestion.ApiKeyConfirm"),
|
|
919
714
|
type: "confirm",
|
|
920
715
|
default: true,
|
|
@@ -925,7 +720,7 @@ function apiSpecApiKeyQuestion() {
|
|
|
925
720
|
return {
|
|
926
721
|
data: {
|
|
927
722
|
type: "text",
|
|
928
|
-
name:
|
|
723
|
+
name: constants_4.QuestionNames.ApiSpecApiKey,
|
|
929
724
|
cliShortName: "k",
|
|
930
725
|
title: localizeUtils_1.getLocalizedString("core.createProjectQuestion.ApiKey"),
|
|
931
726
|
cliDescription: "Api key for OpenAPI spec.",
|
|
@@ -943,7 +738,7 @@ function apiSpecApiKeyQuestion() {
|
|
|
943
738
|
if (!inputs) {
|
|
944
739
|
throw new Error("inputs is undefined"); // should never happen
|
|
945
740
|
}
|
|
946
|
-
process.env[
|
|
741
|
+
process.env[constants_4.QuestionNames.ApiSpecApiKey] = input;
|
|
947
742
|
return;
|
|
948
743
|
},
|
|
949
744
|
},
|
|
@@ -994,7 +789,7 @@ exports.oauthQuestion = oauthQuestion;
|
|
|
994
789
|
function oauthClientIdQuestion() {
|
|
995
790
|
return {
|
|
996
791
|
type: "text",
|
|
997
|
-
name:
|
|
792
|
+
name: constants_4.QuestionNames.OauthClientId,
|
|
998
793
|
cliShortName: "i",
|
|
999
794
|
title: localizeUtils_1.getLocalizedString("core.createProjectQuestion.OauthClientId"),
|
|
1000
795
|
cliDescription: "Oauth client id for OpenAPI spec.",
|
|
@@ -1004,7 +799,7 @@ function oauthClientIdQuestion() {
|
|
|
1004
799
|
if (!inputs) {
|
|
1005
800
|
throw new Error("inputs is undefined"); // should never happen
|
|
1006
801
|
}
|
|
1007
|
-
process.env[
|
|
802
|
+
process.env[constants_4.QuestionNames.OauthClientId] = input;
|
|
1008
803
|
return;
|
|
1009
804
|
},
|
|
1010
805
|
},
|
|
@@ -1012,7 +807,7 @@ function oauthClientIdQuestion() {
|
|
|
1012
807
|
}
|
|
1013
808
|
function oauthConfirmQestion() {
|
|
1014
809
|
return {
|
|
1015
|
-
name:
|
|
810
|
+
name: constants_4.QuestionNames.OauthConfirm,
|
|
1016
811
|
title: localizeUtils_1.getLocalizedString("core.createProjectQuestion.OauthClientSecretConfirm"),
|
|
1017
812
|
type: "confirm",
|
|
1018
813
|
default: true,
|
|
@@ -1021,7 +816,7 @@ function oauthConfirmQestion() {
|
|
|
1021
816
|
function oauthClientSecretQuestion() {
|
|
1022
817
|
return {
|
|
1023
818
|
type: "text",
|
|
1024
|
-
name:
|
|
819
|
+
name: constants_4.QuestionNames.OauthClientSecret,
|
|
1025
820
|
cliShortName: "c",
|
|
1026
821
|
title: localizeUtils_1.getLocalizedString("core.createProjectQuestion.OauthClientSecret"),
|
|
1027
822
|
cliDescription: "Oauth client secret for OpenAPI spec.",
|
|
@@ -1039,7 +834,7 @@ function oauthClientSecretQuestion() {
|
|
|
1039
834
|
if (!inputs) {
|
|
1040
835
|
throw new Error("inputs is undefined"); // should never happen
|
|
1041
836
|
}
|
|
1042
|
-
process.env[
|
|
837
|
+
process.env[constants_4.QuestionNames.OauthClientSecret] = input;
|
|
1043
838
|
return;
|
|
1044
839
|
},
|
|
1045
840
|
},
|