@microsoft/teamsfx-core 3.1.4 → 3.1.5-alpha.3256bba3fe.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/README.md +4 -0
- package/build/common/featureFlags.d.ts +5 -0
- package/build/common/featureFlags.d.ts.map +1 -1
- package/build/common/featureFlags.js +5 -0
- package/build/common/featureFlags.js.map +1 -1
- package/build/common/telemetry.d.ts +2 -1
- package/build/common/telemetry.d.ts.map +1 -1
- package/build/common/telemetry.js +1 -0
- package/build/common/telemetry.js.map +1 -1
- package/build/common/templates-config.json +2 -2
- package/build/common/wrappedAxiosClient.d.ts +5 -0
- package/build/common/wrappedAxiosClient.d.ts.map +1 -1
- package/build/common/wrappedAxiosClient.js +95 -4
- package/build/common/wrappedAxiosClient.js.map +1 -1
- package/build/component/configManager/actionInjector.d.ts +1 -1
- package/build/component/configManager/actionInjector.d.ts.map +1 -1
- package/build/component/configManager/actionInjector.js +2 -2
- package/build/component/configManager/actionInjector.js.map +1 -1
- package/build/component/driver/copilotAgent/publish.d.ts.map +1 -1
- package/build/component/driver/copilotAgent/publish.js +1 -1
- package/build/component/driver/copilotAgent/publish.js.map +1 -1
- package/build/component/driver/dcr/create.d.ts.map +1 -1
- package/build/component/driver/dcr/create.js +47 -14
- package/build/component/driver/dcr/create.js.map +1 -1
- package/build/component/driver/dcr/interface/createDcrArgs.d.ts +4 -1
- package/build/component/driver/dcr/interface/createDcrArgs.d.ts.map +1 -1
- package/build/component/driver/index.d.ts +0 -1
- package/build/component/driver/index.d.ts.map +1 -1
- package/build/component/driver/index.js +0 -1
- package/build/component/driver/index.js.map +1 -1
- package/build/component/driver/m365/acquire.d.ts.map +1 -1
- package/build/component/driver/m365/acquire.js +2 -2
- package/build/component/driver/m365/acquire.js.map +1 -1
- package/build/component/driver/oauth/create.d.ts.map +1 -1
- package/build/component/driver/oauth/create.js +16 -2
- package/build/component/driver/oauth/create.js.map +1 -1
- package/build/component/driver/oauth/error/oauthSupportedAccountTypesUnsupportedCloud.d.ts +5 -0
- package/build/component/driver/oauth/error/oauthSupportedAccountTypesUnsupportedCloud.d.ts.map +1 -0
- package/build/component/driver/oauth/error/oauthSupportedAccountTypesUnsupportedCloud.js +13 -0
- package/build/component/driver/oauth/error/oauthSupportedAccountTypesUnsupportedCloud.js.map +1 -0
- package/build/component/driver/oauth/interface/createOauthArgs.d.ts +1 -0
- package/build/component/driver/oauth/interface/createOauthArgs.d.ts.map +1 -1
- package/build/component/driver/oauth/interface/updateOauthArgs.d.ts +1 -0
- package/build/component/driver/oauth/interface/updateOauthArgs.d.ts.map +1 -1
- package/build/component/driver/oauth/update.d.ts.map +1 -1
- package/build/component/driver/oauth/update.js +26 -4
- package/build/component/driver/oauth/update.js.map +1 -1
- package/build/component/driver/oauth/utility/supportedAccountTypes.d.ts +6 -0
- package/build/component/driver/oauth/utility/supportedAccountTypes.d.ts.map +1 -0
- package/build/component/driver/oauth/utility/supportedAccountTypes.js +31 -0
- package/build/component/driver/oauth/utility/supportedAccountTypes.js.map +1 -0
- package/build/component/driver/teamsApp/constants.d.ts +5 -0
- package/build/component/driver/teamsApp/constants.d.ts.map +1 -1
- package/build/component/driver/teamsApp/constants.js +5 -0
- package/build/component/driver/teamsApp/constants.js.map +1 -1
- package/build/component/driver/teamsApp/interfaces/DcrRegistration.d.ts +5 -2
- package/build/component/driver/teamsApp/interfaces/DcrRegistration.d.ts.map +1 -1
- package/build/component/driver/teamsApp/interfaces/OauthRegistration.d.ts +6 -0
- package/build/component/driver/teamsApp/interfaces/OauthRegistration.d.ts.map +1 -1
- package/build/component/driver/teamsApp/interfaces/OauthRegistration.js +5 -1
- package/build/component/driver/teamsApp/interfaces/OauthRegistration.js.map +1 -1
- package/build/component/generator/generatorProvider.d.ts.map +1 -1
- package/build/component/generator/generatorProvider.js +0 -3
- package/build/component/generator/generatorProvider.js.map +1 -1
- package/build/component/generator/templates/templateNames.d.ts +1 -1
- package/build/component/generator/templates/templateNames.d.ts.map +1 -1
- package/build/component/m365/packageService.d.ts +4 -3
- package/build/component/m365/packageService.d.ts.map +1 -1
- package/build/component/m365/packageService.js +34 -30
- package/build/component/m365/packageService.js.map +1 -1
- package/build/component/m365/serviceConstant.d.ts.map +1 -1
- package/build/component/m365/serviceConstant.js +5 -0
- package/build/component/m365/serviceConstant.js.map +1 -1
- package/build/component/m365/skills/graphSkillFileStore.d.ts +14 -0
- package/build/component/m365/skills/graphSkillFileStore.d.ts.map +1 -0
- package/build/component/m365/skills/graphSkillFileStore.js +164 -0
- package/build/component/m365/skills/graphSkillFileStore.js.map +1 -0
- package/build/component/m365/skills/incrementalSkillUpload.d.ts +6 -0
- package/build/component/m365/skills/incrementalSkillUpload.d.ts.map +1 -0
- package/build/component/m365/skills/incrementalSkillUpload.js +70 -0
- package/build/component/m365/skills/incrementalSkillUpload.js.map +1 -0
- package/build/component/m365/skills/skillDirectoryClient.d.ts +12 -0
- package/build/component/m365/skills/skillDirectoryClient.d.ts.map +1 -0
- package/build/component/m365/skills/skillDirectoryClient.js +150 -0
- package/build/component/m365/skills/skillDirectoryClient.js.map +1 -0
- package/build/component/m365/skills/skillFileSync.d.ts +35 -0
- package/build/component/m365/skills/skillFileSync.d.ts.map +1 -0
- package/build/component/m365/skills/skillFileSync.js +256 -0
- package/build/component/m365/skills/skillFileSync.js.map +1 -0
- package/build/component/m365/skills/skillPackage.d.ts +40 -0
- package/build/component/m365/skills/skillPackage.d.ts.map +1 -0
- package/build/component/m365/skills/skillPackage.js +471 -0
- package/build/component/m365/skills/skillPackage.js.map +1 -0
- package/build/component/m365/skills/skillRequest.d.ts +7 -0
- package/build/component/m365/skills/skillRequest.d.ts.map +1 -0
- package/build/component/m365/skills/skillRequest.js +91 -0
- package/build/component/m365/skills/skillRequest.js.map +1 -0
- package/build/component/utils/mcpAuthScaffolder.d.ts +5 -20
- package/build/component/utils/mcpAuthScaffolder.d.ts.map +1 -1
- package/build/component/utils/mcpAuthScaffolder.js +9 -24
- package/build/component/utils/mcpAuthScaffolder.js.map +1 -1
- package/build/core/FxCore.d.ts +2 -4
- package/build/core/FxCore.d.ts.map +1 -1
- package/build/core/FxCore.js +7 -22
- package/build/core/FxCore.js.map +1 -1
- package/build/question/create.d.ts +0 -6
- package/build/question/create.d.ts.map +1 -1
- package/build/question/create.js +119 -281
- package/build/question/create.js.map +1 -1
- package/build/question/generator.js +0 -2
- package/build/question/generator.js.map +1 -1
- package/build/question/index.d.ts +0 -1
- package/build/question/index.d.ts.map +1 -1
- package/build/question/index.js +0 -3
- package/build/question/index.js.map +1 -1
- package/build/question/inputs/index.d.ts +0 -1
- package/build/question/inputs/index.d.ts.map +1 -1
- package/build/question/inputs/index.js +0 -1
- package/build/question/inputs/index.js.map +1 -1
- package/build/question/options/CreateProjectOptions.d.ts.map +1 -1
- package/build/question/options/CreateProjectOptions.js +0 -1
- package/build/question/options/CreateProjectOptions.js.map +1 -1
- package/build/question/options/index.d.ts +0 -1
- package/build/question/options/index.d.ts.map +1 -1
- package/build/question/options/index.js +0 -1
- package/build/question/options/index.js.map +1 -1
- package/build/question/other.d.ts +0 -1
- package/build/question/other.d.ts.map +1 -1
- package/build/question/other.js +158 -214
- package/build/question/other.js.map +1 -1
- package/build/question/scaffold/vsc/CapabilityOptions.d.ts +0 -1
- package/build/question/scaffold/vsc/CapabilityOptions.d.ts.map +1 -1
- package/build/question/scaffold/vsc/CapabilityOptions.js +0 -9
- package/build/question/scaffold/vsc/CapabilityOptions.js.map +1 -1
- package/build/question/scaffold/vsc/teamsProjectTypeNode.d.ts.map +1 -1
- package/build/question/scaffold/vsc/teamsProjectTypeNode.js +0 -24
- package/build/question/scaffold/vsc/teamsProjectTypeNode.js.map +1 -1
- package/build/v4/mcp/mcpAuthAction.d.ts +0 -1
- package/build/v4/mcp/mcpAuthAction.d.ts.map +1 -1
- package/build/v4/mcp/mcpAuthAction.js +5 -7
- package/build/v4/mcp/mcpAuthAction.js.map +1 -1
- package/build/v4/mcp/mcpAuthScaffold.d.ts.map +1 -1
- package/build/v4/mcp/mcpAuthScaffold.js +4 -12
- package/build/v4/mcp/mcpAuthScaffold.js.map +1 -1
- package/package.json +11 -8
- package/resource/package.nls.cs.json +72 -68
- package/resource/package.nls.de.json +72 -68
- package/resource/package.nls.es.json +72 -68
- package/resource/package.nls.fr.json +72 -68
- package/resource/package.nls.it.json +72 -68
- package/resource/package.nls.ja.json +72 -68
- package/resource/package.nls.json +15 -58
- package/resource/package.nls.ko.json +72 -68
- package/resource/package.nls.pl.json +72 -68
- package/resource/package.nls.pt-BR.json +72 -68
- package/resource/package.nls.ru.json +72 -68
- package/resource/package.nls.tr.json +72 -68
- package/resource/package.nls.zh-Hans.json +72 -68
- package/resource/package.nls.zh-Hant.json +72 -68
- package/resource/yaml-schema/v1.13/yaml.schema.json +71 -33
- package/resource/yaml-schema/yaml.schema.json +71 -33
- 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/metadata.zip +0 -0
- package/templates/v4/floor.json +1 -1
- package/templates/v4/templates-metadata.zip +0 -0
- package/templates/v4/templates.zip +0 -0
- package/build/common/treatmentVariables.d.ts +0 -5
- package/build/common/treatmentVariables.d.ts.map +0 -1
- package/build/common/treatmentVariables.js +0 -10
- package/build/common/treatmentVariables.js.map +0 -1
- package/build/component/driver/add/addWebPart.d.ts +0 -12
- package/build/component/driver/add/addWebPart.d.ts.map +0 -1
- package/build/component/driver/add/addWebPart.js +0 -109
- package/build/component/driver/add/addWebPart.js.map +0 -1
- package/build/component/driver/add/error/noConfigurationError.d.ts +0 -5
- package/build/component/driver/add/error/noConfigurationError.d.ts.map +0 -1
- package/build/component/driver/add/error/noConfigurationError.js +0 -22
- package/build/component/driver/add/error/noConfigurationError.js.map +0 -1
- package/build/component/driver/add/interface/AddWebPartArgs.d.ts +0 -27
- package/build/component/driver/add/interface/AddWebPartArgs.d.ts.map +0 -1
- package/build/component/driver/add/interface/AddWebPartArgs.js +0 -5
- package/build/component/driver/add/interface/AddWebPartArgs.js.map +0 -1
- package/build/component/driver/add/utility/constants.d.ts +0 -8
- package/build/component/driver/add/utility/constants.d.ts.map +0 -1
- package/build/component/driver/add/utility/constants.js +0 -14
- package/build/component/driver/add/utility/constants.js.map +0 -1
- package/build/component/generator/spfx/depsChecker/dependencyChecker.d.ts +0 -4
- package/build/component/generator/spfx/depsChecker/dependencyChecker.d.ts.map +0 -1
- package/build/component/generator/spfx/depsChecker/dependencyChecker.js +0 -5
- package/build/component/generator/spfx/depsChecker/dependencyChecker.js.map +0 -1
- package/build/component/generator/spfx/depsChecker/generatorChecker.d.ts +0 -20
- package/build/component/generator/spfx/depsChecker/generatorChecker.d.ts.map +0 -1
- package/build/component/generator/spfx/depsChecker/generatorChecker.js +0 -129
- package/build/component/generator/spfx/depsChecker/generatorChecker.js.map +0 -1
- package/build/component/generator/spfx/depsChecker/yoChecker.d.ts +0 -20
- package/build/component/generator/spfx/depsChecker/yoChecker.d.ts.map +0 -1
- package/build/component/generator/spfx/depsChecker/yoChecker.js +0 -143
- package/build/component/generator/spfx/depsChecker/yoChecker.js.map +0 -1
- package/build/component/generator/spfx/error.d.ts +0 -15
- package/build/component/generator/spfx/error.d.ts.map +0 -1
- package/build/component/generator/spfx/error.js +0 -124
- package/build/component/generator/spfx/error.js.map +0 -1
- package/build/component/generator/spfx/spfxGenerator.d.ts +0 -30
- package/build/component/generator/spfx/spfxGenerator.d.ts.map +0 -1
- package/build/component/generator/spfx/spfxGenerator.js +0 -684
- package/build/component/generator/spfx/spfxGenerator.js.map +0 -1
- package/build/component/generator/spfx/utils/constants.d.ts +0 -45
- package/build/component/generator/spfx/utils/constants.d.ts.map +0 -1
- package/build/component/generator/spfx/utils/constants.js +0 -56
- package/build/component/generator/spfx/utils/constants.js.map +0 -1
- package/build/component/generator/spfx/utils/progress-helper.d.ts +0 -9
- package/build/component/generator/spfx/utils/progress-helper.d.ts.map +0 -1
- package/build/component/generator/spfx/utils/progress-helper.js +0 -22
- package/build/component/generator/spfx/utils/progress-helper.js.map +0 -1
- package/build/component/generator/spfx/utils/telemetry-helper.d.ts +0 -14
- package/build/component/generator/spfx/utils/telemetry-helper.d.ts.map +0 -1
- package/build/component/generator/spfx/utils/telemetry-helper.js +0 -31
- package/build/component/generator/spfx/utils/telemetry-helper.js.map +0 -1
- package/build/component/generator/spfx/utils/telemetryEvents.d.ts +0 -20
- package/build/component/generator/spfx/utils/telemetryEvents.d.ts.map +0 -1
- package/build/component/generator/spfx/utils/telemetryEvents.js +0 -27
- package/build/component/generator/spfx/utils/telemetryEvents.js.map +0 -1
- package/build/component/generator/spfx/utils/utils.d.ts +0 -19
- package/build/component/generator/spfx/utils/utils.d.ts.map +0 -1
- package/build/component/generator/spfx/utils/utils.js +0 -184
- package/build/component/generator/spfx/utils/utils.js.map +0 -1
- package/build/question/inputs/SPFxAddWebpartInputs.d.ts +0 -20
- package/build/question/inputs/SPFxAddWebpartInputs.d.ts.map +0 -1
- package/build/question/inputs/SPFxAddWebpartInputs.js +0 -5
- package/build/question/inputs/SPFxAddWebpartInputs.js.map +0 -1
- package/build/question/options/SPFxAddWebpartOptions.d.ts +0 -10
- package/build/question/options/SPFxAddWebpartOptions.d.ts.map +0 -1
- package/build/question/options/SPFxAddWebpartOptions.js +0 -50
- package/build/question/options/SPFxAddWebpartOptions.js.map +0 -1
package/build/question/create.js
CHANGED
|
@@ -4,13 +4,7 @@
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
exports.selectTabsContentUrlQuestion = exports.createQuestionDeps = exports.listOperations = exports.createContext = void 0;
|
|
6
6
|
exports.getProjectTypeAndCapability = getProjectTypeAndCapability;
|
|
7
|
-
exports.SPFxSolutionQuestion = SPFxSolutionQuestion;
|
|
8
|
-
exports.SPFxPackageSelectQuestion = SPFxPackageSelectQuestion;
|
|
9
|
-
exports.SPFxFrameworkQuestion = SPFxFrameworkQuestion;
|
|
10
|
-
exports.SPFxWebpartNameQuestion = SPFxWebpartNameQuestion;
|
|
11
|
-
exports.SPFxImportFolderQuestion = SPFxImportFolderQuestion;
|
|
12
7
|
exports.folderQuestion = folderQuestion;
|
|
13
|
-
exports.getSolutionName = getSolutionName;
|
|
14
8
|
exports.appNameQuestion = appNameQuestion;
|
|
15
9
|
exports.getTabWebsiteOptions = getTabWebsiteOptions;
|
|
16
10
|
exports.selectTabWebsiteUrlQuestion = selectTabWebsiteUrlQuestion;
|
|
@@ -71,15 +65,12 @@ const utils_1 = require("../component/driver/teamsApp/utils/utils");
|
|
|
71
65
|
const constant_1 = require("../component/generator/constant");
|
|
72
66
|
const helper_1 = require("../component/generator/declarativeAgent/helper");
|
|
73
67
|
const helper_2 = require("../component/generator/openApiSpec/helper");
|
|
74
|
-
const error_1 = require("../component/generator/spfx/error");
|
|
75
|
-
const constants_2 = require("../component/generator/spfx/utils/constants");
|
|
76
|
-
const utils_2 = require("../component/generator/spfx/utils/utils");
|
|
77
68
|
const templateNames_1 = require("../component/generator/templates/templateNames");
|
|
78
|
-
const
|
|
79
|
-
const
|
|
69
|
+
const error_1 = require("../error");
|
|
70
|
+
const constants_2 = require("./constants");
|
|
80
71
|
const CapabilityOptions_1 = require("./scaffold/vsc/CapabilityOptions");
|
|
81
72
|
const ProjectTypeOptions_1 = require("./scaffold/vsc/ProjectTypeOptions");
|
|
82
|
-
const
|
|
73
|
+
const utils_2 = require("./utils");
|
|
83
74
|
exports.createContext = globalVars_1.createContext;
|
|
84
75
|
exports.listOperations = helper_2.listOperations;
|
|
85
76
|
exports.createQuestionDeps = {
|
|
@@ -101,145 +92,10 @@ function getProjectTypeAndCapability(teamsApp) {
|
|
|
101
92
|
}
|
|
102
93
|
return undefined;
|
|
103
94
|
}
|
|
104
|
-
function SPFxSolutionQuestion() {
|
|
105
|
-
return {
|
|
106
|
-
type: "singleSelect",
|
|
107
|
-
name: constants_3.QuestionNames.SPFxSolution,
|
|
108
|
-
title: (0, localizeUtils_1.getLocalizedString)("plugins.spfx.questions.spfxSolution.title"),
|
|
109
|
-
cliDescription: "Create a new or import an existing SharePoint Framework solution.",
|
|
110
|
-
cliShortName: "s",
|
|
111
|
-
staticOptions: [
|
|
112
|
-
{
|
|
113
|
-
id: "new",
|
|
114
|
-
label: (0, localizeUtils_1.getLocalizedString)("plugins.spfx.questions.spfxSolution.createNew"),
|
|
115
|
-
detail: (0, localizeUtils_1.getLocalizedString)("plugins.spfx.questions.spfxSolution.createNew.detail"),
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
id: "import",
|
|
119
|
-
label: (0, localizeUtils_1.getLocalizedString)("plugins.spfx.questions.spfxSolution.importExisting"),
|
|
120
|
-
detail: (0, localizeUtils_1.getLocalizedString)("plugins.spfx.questions.spfxSolution.importExisting.detail"),
|
|
121
|
-
},
|
|
122
|
-
],
|
|
123
|
-
default: "new",
|
|
124
|
-
};
|
|
125
|
-
}
|
|
126
|
-
function SPFxPackageSelectQuestion() {
|
|
127
|
-
return {
|
|
128
|
-
type: "singleSelect",
|
|
129
|
-
name: constants_3.QuestionNames.SPFxInstallPackage,
|
|
130
|
-
title: (0, localizeUtils_1.getLocalizedString)("plugins.spfx.questions.packageSelect.title"),
|
|
131
|
-
cliDescription: "Install the latest version of SharePoint Framework.",
|
|
132
|
-
staticOptions: [],
|
|
133
|
-
placeholder: (0, localizeUtils_1.getLocalizedString)("plugins.spfx.questions.packageSelect.placeholder"),
|
|
134
|
-
dynamicOptions: async (inputs) => {
|
|
135
|
-
const versions = await Promise.all([
|
|
136
|
-
utils_2.Utils.findGloballyInstalledVersion(undefined, constants_2.Constants.GeneratorPackageName, 0, false),
|
|
137
|
-
utils_2.Utils.findLatestVersion(undefined, constants_2.Constants.GeneratorPackageName, 5),
|
|
138
|
-
utils_2.Utils.findGloballyInstalledVersion(undefined, constants_2.Constants.YeomanPackageName, 0, false),
|
|
139
|
-
]);
|
|
140
|
-
inputs.globalSpfxPackageVersion = versions[0];
|
|
141
|
-
inputs.latestSpfxPackageVersion = versions[1];
|
|
142
|
-
inputs.globalYeomanPackageVersion = versions[2];
|
|
143
|
-
return [
|
|
144
|
-
{
|
|
145
|
-
id: constants_3.SPFxVersionOptionIds.installLocally,
|
|
146
|
-
label: versions[1] !== undefined
|
|
147
|
-
? (0, localizeUtils_1.getLocalizedString)("plugins.spfx.questions.packageSelect.installLocally.withVersion.label", "v" + versions[1])
|
|
148
|
-
: (0, localizeUtils_1.getLocalizedString)("plugins.spfx.questions.packageSelect.installLocally.noVersion.label"),
|
|
149
|
-
},
|
|
150
|
-
{
|
|
151
|
-
id: constants_3.SPFxVersionOptionIds.globalPackage,
|
|
152
|
-
label: versions[0] !== undefined
|
|
153
|
-
? (0, localizeUtils_1.getLocalizedString)("plugins.spfx.questions.packageSelect.useGlobalPackage.withVersion.label", "v" + versions[0])
|
|
154
|
-
: (0, localizeUtils_1.getLocalizedString)("plugins.spfx.questions.packageSelect.useGlobalPackage.noVersion.label"),
|
|
155
|
-
description: (0, localizeUtils_1.getLocalizedString)("plugins.spfx.questions.packageSelect.useGlobalPackage.detail", constants_2.Constants.RecommendedLowestSpfxVersion),
|
|
156
|
-
},
|
|
157
|
-
];
|
|
158
|
-
},
|
|
159
|
-
default: constants_3.SPFxVersionOptionIds.installLocally,
|
|
160
|
-
validation: {
|
|
161
|
-
validFunc: (input, previousInputs) => {
|
|
162
|
-
if (input === constants_3.SPFxVersionOptionIds.globalPackage) {
|
|
163
|
-
const hasPackagesInstalled = !!previousInputs &&
|
|
164
|
-
!!previousInputs.globalSpfxPackageVersion &&
|
|
165
|
-
!!previousInputs.globalYeomanPackageVersion;
|
|
166
|
-
if (!hasPackagesInstalled) {
|
|
167
|
-
return Promise.reject((0, error_1.DevEnvironmentSetupError)());
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
return Promise.resolve(undefined);
|
|
171
|
-
},
|
|
172
|
-
},
|
|
173
|
-
isBoolean: true,
|
|
174
|
-
};
|
|
175
|
-
}
|
|
176
|
-
function SPFxFrameworkQuestion() {
|
|
177
|
-
return {
|
|
178
|
-
type: "singleSelect",
|
|
179
|
-
name: constants_3.QuestionNames.SPFxFramework,
|
|
180
|
-
cliShortName: "k",
|
|
181
|
-
cliDescription: "Framework.",
|
|
182
|
-
title: (0, localizeUtils_1.getLocalizedString)("plugins.spfx.questions.framework.title"),
|
|
183
|
-
staticOptions: [
|
|
184
|
-
{ id: "react", label: "React" },
|
|
185
|
-
{ id: "minimal", label: "Minimal" },
|
|
186
|
-
{ id: "none", label: "None" },
|
|
187
|
-
],
|
|
188
|
-
placeholder: "Select an option",
|
|
189
|
-
default: "react",
|
|
190
|
-
};
|
|
191
|
-
}
|
|
192
|
-
function SPFxWebpartNameQuestion() {
|
|
193
|
-
return {
|
|
194
|
-
type: "text",
|
|
195
|
-
name: constants_3.QuestionNames.SPFxWebpartName,
|
|
196
|
-
cliShortName: "w",
|
|
197
|
-
cliDescription: "Name for SharePoint Framework Web Part.",
|
|
198
|
-
title: (0, localizeUtils_1.getLocalizedString)("plugins.spfx.questions.webpartName"),
|
|
199
|
-
default: constants_2.Constants.DEFAULT_WEBPART_NAME,
|
|
200
|
-
validation: {
|
|
201
|
-
validFunc: async (input, previousInputs) => {
|
|
202
|
-
const schema = {
|
|
203
|
-
pattern: "^[a-zA-Z_][a-zA-Z0-9_]*$",
|
|
204
|
-
};
|
|
205
|
-
const validateRes = jsonschema.validate(input, schema);
|
|
206
|
-
if (validateRes.errors && validateRes.errors.length > 0) {
|
|
207
|
-
return (0, localizeUtils_1.getLocalizedString)("plugins.spfx.questions.webpartName.error.notMatch", input, schema.pattern);
|
|
208
|
-
}
|
|
209
|
-
if (previousInputs &&
|
|
210
|
-
((previousInputs.stage === teamsfx_api_1.Stage.addWebpart &&
|
|
211
|
-
previousInputs[constants_3.QuestionNames.SPFxFolder]) ||
|
|
212
|
-
(previousInputs?.stage === teamsfx_api_1.Stage.addFeature && previousInputs?.projectPath))) {
|
|
213
|
-
const webpartFolder = path.join(previousInputs[constants_3.QuestionNames.SPFxFolder], "src", "webparts", input);
|
|
214
|
-
if (await fs_extra_1.default.pathExists(webpartFolder)) {
|
|
215
|
-
return (0, localizeUtils_1.getLocalizedString)("plugins.spfx.questions.webpartName.error.duplicate", webpartFolder);
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
return undefined;
|
|
219
|
-
},
|
|
220
|
-
},
|
|
221
|
-
};
|
|
222
|
-
}
|
|
223
|
-
function SPFxImportFolderQuestion(hasDefaultFunc = false) {
|
|
224
|
-
return {
|
|
225
|
-
type: "folder",
|
|
226
|
-
name: constants_3.QuestionNames.SPFxFolder,
|
|
227
|
-
title: (0, localizeUtils_1.getLocalizedString)("core.spfxFolder.title"),
|
|
228
|
-
cliDescription: "Directory or Path that contains the existing SharePoint Framework solution.",
|
|
229
|
-
placeholder: (0, localizeUtils_1.getLocalizedString)("core.spfxFolder.placeholder"),
|
|
230
|
-
default: hasDefaultFunc
|
|
231
|
-
? (inputs) => {
|
|
232
|
-
if (inputs.projectPath)
|
|
233
|
-
return path.join(inputs.projectPath, "src");
|
|
234
|
-
return undefined;
|
|
235
|
-
}
|
|
236
|
-
: undefined,
|
|
237
|
-
};
|
|
238
|
-
}
|
|
239
95
|
function folderQuestion() {
|
|
240
96
|
return {
|
|
241
97
|
type: "folder",
|
|
242
|
-
name:
|
|
98
|
+
name: constants_2.QuestionNames.Folder,
|
|
243
99
|
cliShortName: "f",
|
|
244
100
|
title: (inputs) => teamsfx_api_1.CLIPlatforms.includes(inputs.platform)
|
|
245
101
|
? "Directory where the project folder will be created in"
|
|
@@ -251,42 +107,24 @@ function folderQuestion() {
|
|
|
251
107
|
: path.join(os.homedir(), constants_1.ConstantString.RootFolder),
|
|
252
108
|
};
|
|
253
109
|
}
|
|
254
|
-
async function getSolutionName(spfxFolder) {
|
|
255
|
-
const yoInfoPath = path.join(spfxFolder, constants_2.Constants.YO_RC_FILE);
|
|
256
|
-
if (await fs_extra_1.default.pathExists(yoInfoPath)) {
|
|
257
|
-
const yoInfo = await fs_extra_1.default.readJson(yoInfoPath);
|
|
258
|
-
if (yoInfo["@microsoft/generator-sharepoint"]) {
|
|
259
|
-
return yoInfo["@microsoft/generator-sharepoint"][constants_2.Constants.YO_RC_SOLUTION_NAME];
|
|
260
|
-
}
|
|
261
|
-
else {
|
|
262
|
-
return undefined;
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
else {
|
|
266
|
-
throw new error_2.FileNotFoundError(constants_2.Constants.PLUGIN_NAME, yoInfoPath, constants_2.Constants.IMPORT_HELP_LINK);
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
110
|
function appNameQuestion() {
|
|
270
111
|
const question = {
|
|
271
112
|
type: "text",
|
|
272
|
-
name:
|
|
113
|
+
name: constants_2.QuestionNames.AppName,
|
|
273
114
|
cliShortName: "n",
|
|
274
115
|
title: (0, localizeUtils_1.getLocalizedString)("core.question.appName.title"),
|
|
275
116
|
required: true,
|
|
276
|
-
default:
|
|
117
|
+
default: (inputs) => {
|
|
277
118
|
let defaultName = undefined;
|
|
278
119
|
if (inputs.teamsAppFromTdp?.appName) {
|
|
279
120
|
defaultName = (0, stringUtils_1.convertToAlphanumericOnly)(inputs.teamsAppFromTdp?.appName);
|
|
280
121
|
}
|
|
281
|
-
|
|
282
|
-
defaultName = await getSolutionName(inputs[constants_3.QuestionNames.SPFxFolder]);
|
|
283
|
-
}
|
|
284
|
-
return defaultName;
|
|
122
|
+
return Promise.resolve(defaultName);
|
|
285
123
|
},
|
|
286
124
|
validation: {
|
|
287
125
|
validFunc: async (input, previousInputs) => {
|
|
288
126
|
const schema = {
|
|
289
|
-
pattern:
|
|
127
|
+
pattern: constants_2.AppNamePattern,
|
|
290
128
|
maxLength: 30,
|
|
291
129
|
};
|
|
292
130
|
if (input.length === 25) {
|
|
@@ -328,7 +166,7 @@ function appNameQuestion() {
|
|
|
328
166
|
function sampleSelectQuestion() {
|
|
329
167
|
return {
|
|
330
168
|
type: "singleSelect",
|
|
331
|
-
name:
|
|
169
|
+
name: constants_2.QuestionNames.Samples,
|
|
332
170
|
cliName: "sample-name",
|
|
333
171
|
cliDescription: "Specifies the app sample name.",
|
|
334
172
|
cliChoiceListCommand: "teamsapp list samples",
|
|
@@ -412,7 +250,7 @@ function getTabWebsiteOptions(inputs) {
|
|
|
412
250
|
function selectTabWebsiteUrlQuestion() {
|
|
413
251
|
return {
|
|
414
252
|
type: "multiSelect",
|
|
415
|
-
name:
|
|
253
|
+
name: constants_2.QuestionNames.ReplaceWebsiteUrl,
|
|
416
254
|
title: (0, localizeUtils_1.getLocalizedString)("core.updateWebsiteUrlQuestion.title"),
|
|
417
255
|
staticOptions: [],
|
|
418
256
|
dynamicOptions: getTabWebsiteOptions,
|
|
@@ -434,7 +272,7 @@ function getTabContentUrlOptions(inputs) {
|
|
|
434
272
|
const selectTabsContentUrlQuestion = () => {
|
|
435
273
|
return {
|
|
436
274
|
type: "multiSelect",
|
|
437
|
-
name:
|
|
275
|
+
name: constants_2.QuestionNames.ReplaceContentUrl,
|
|
438
276
|
title: (0, localizeUtils_1.getLocalizedString)("core.updateContentUrlQuestion.title"),
|
|
439
277
|
staticOptions: [],
|
|
440
278
|
dynamicOptions: getTabContentUrlOptions,
|
|
@@ -483,7 +321,7 @@ function getBotOptions(inputs) {
|
|
|
483
321
|
function selectBotIdsQuestion() {
|
|
484
322
|
return {
|
|
485
323
|
type: "multiSelect",
|
|
486
|
-
name:
|
|
324
|
+
name: constants_2.QuestionNames.ReplaceBotIds,
|
|
487
325
|
title: (0, localizeUtils_1.getLocalizedString)("core.updateBotIdsQuestion.title"),
|
|
488
326
|
staticOptions: [],
|
|
489
327
|
dynamicOptions: getBotOptions,
|
|
@@ -495,7 +333,7 @@ function selectBotIdsQuestion() {
|
|
|
495
333
|
function apiSpecTypeSelectQuestion() {
|
|
496
334
|
return {
|
|
497
335
|
type: "singleSelect",
|
|
498
|
-
name:
|
|
336
|
+
name: constants_2.QuestionNames.OpenAPISpecType,
|
|
499
337
|
title: "OpenAPI Spec Document",
|
|
500
338
|
cliDescription: "The type of the API spec.",
|
|
501
339
|
staticOptions: [
|
|
@@ -513,14 +351,14 @@ function apiSpecTypeSelectQuestion() {
|
|
|
513
351
|
},
|
|
514
352
|
],
|
|
515
353
|
onDidSelection(itemOrId, inputs) {
|
|
516
|
-
inputs[
|
|
354
|
+
inputs[constants_2.QuestionNames.ActionType] = constants_2.ActionStartOptions.apiSpec().id;
|
|
517
355
|
},
|
|
518
356
|
};
|
|
519
357
|
}
|
|
520
358
|
function searchOpenAPISpecQueryQuestion() {
|
|
521
359
|
return {
|
|
522
360
|
type: "text",
|
|
523
|
-
name:
|
|
361
|
+
name: constants_2.QuestionNames.SearchOpenAPISpecQuery,
|
|
524
362
|
title: (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.capability.searchOpenAPISpecQueryQuestion.label"),
|
|
525
363
|
default: "",
|
|
526
364
|
placeholder: (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.capability.searchOpenAPISpecQueryQuestion.placeholder"),
|
|
@@ -551,7 +389,7 @@ function searchOpenAPISpecQueryQuestion() {
|
|
|
551
389
|
function selectOpenApiSpecQuestion() {
|
|
552
390
|
return {
|
|
553
391
|
type: "singleSelect",
|
|
554
|
-
name:
|
|
392
|
+
name: constants_2.QuestionNames.SelectOpenApiSpec,
|
|
555
393
|
title: (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.capability.selectOpenAPISpecQuestion.label"),
|
|
556
394
|
staticOptions: [],
|
|
557
395
|
dynamicOptions: (inputs) => {
|
|
@@ -599,13 +437,13 @@ function apiSpecLocationQuestion(includeExistingAPIs = true) {
|
|
|
599
437
|
}
|
|
600
438
|
}
|
|
601
439
|
catch (e) {
|
|
602
|
-
const error = (0,
|
|
440
|
+
const error = (0, error_1.assembleError)(e);
|
|
603
441
|
throw error;
|
|
604
442
|
}
|
|
605
443
|
};
|
|
606
444
|
return {
|
|
607
445
|
type: "singleFileOrText",
|
|
608
|
-
name:
|
|
446
|
+
name: constants_2.QuestionNames.ApiSpecLocation,
|
|
609
447
|
cliShortName: "a",
|
|
610
448
|
cliDescription: "OpenAPI description document location.",
|
|
611
449
|
title: (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.apiSpec.title"),
|
|
@@ -652,7 +490,7 @@ function apiSpecUrlQuestion() {
|
|
|
652
490
|
const correlationId = correlator_1.Correlator.getId();
|
|
653
491
|
return {
|
|
654
492
|
type: "text",
|
|
655
|
-
name:
|
|
493
|
+
name: constants_2.QuestionNames.ApiSpecLocation,
|
|
656
494
|
cliShortName: "a",
|
|
657
495
|
cliDescription: "OpenAPI description document URL.",
|
|
658
496
|
title: (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.apiSpec.title"),
|
|
@@ -702,7 +540,7 @@ function apiSpecFileQuestion() {
|
|
|
702
540
|
const correlationId = correlator_1.Correlator.getId();
|
|
703
541
|
return {
|
|
704
542
|
type: "singleFile",
|
|
705
|
-
name:
|
|
543
|
+
name: constants_2.QuestionNames.ApiSpecLocation,
|
|
706
544
|
cliDescription: "OpenAPI description document file path.",
|
|
707
545
|
title: (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.apiSpec.title"),
|
|
708
546
|
filters: {
|
|
@@ -741,24 +579,24 @@ function apiSpecFileQuestion() {
|
|
|
741
579
|
function apiAuthQuestion(excludeNone = false) {
|
|
742
580
|
return {
|
|
743
581
|
type: "singleSelect",
|
|
744
|
-
name:
|
|
582
|
+
name: constants_2.QuestionNames.ApiAuth,
|
|
745
583
|
title: (0, localizeUtils_1.getLocalizedString)("template.createProjectQuestion.apiMessageExtensionAuth.title"),
|
|
746
584
|
placeholder: (0, localizeUtils_1.getLocalizedString)("template.createProjectQuestion.apiMessageExtensionAuth.placeholder"),
|
|
747
585
|
cliDescription: "The authentication type for the API.",
|
|
748
|
-
staticOptions:
|
|
586
|
+
staticOptions: constants_2.ApiAuthOptions.all(),
|
|
749
587
|
dynamicOptions: (inputs) => {
|
|
750
|
-
const options = excludeNone ? [] : [
|
|
751
|
-
if (inputs[
|
|
752
|
-
options.push(
|
|
588
|
+
const options = excludeNone ? [] : [constants_2.ApiAuthOptions.none()];
|
|
589
|
+
if (inputs[constants_2.QuestionNames.MeArchitectureType] === constants_2.MeArchitectureOptions.newApi().id) {
|
|
590
|
+
options.push(constants_2.ApiAuthOptions.bearerToken(), constants_2.ApiAuthOptions.microsoftEntra());
|
|
753
591
|
}
|
|
754
|
-
else if (inputs[
|
|
755
|
-
options.push(
|
|
756
|
-
options.push(
|
|
757
|
-
options.push(
|
|
592
|
+
else if (inputs[constants_2.QuestionNames.ActionType] === constants_2.ActionStartOptions.newApi().id) {
|
|
593
|
+
options.push(constants_2.ApiAuthOptions.apiKey());
|
|
594
|
+
options.push(constants_2.ApiAuthOptions.microsoftEntra());
|
|
595
|
+
options.push(constants_2.ApiAuthOptions.oauth());
|
|
758
596
|
}
|
|
759
597
|
return options;
|
|
760
598
|
},
|
|
761
|
-
default:
|
|
599
|
+
default: constants_2.ApiAuthOptions.none().id,
|
|
762
600
|
};
|
|
763
601
|
}
|
|
764
602
|
function apiOperationQuestion(includeExistingAPIs = true, isAddPlugin = false) {
|
|
@@ -766,11 +604,11 @@ function apiOperationQuestion(includeExistingAPIs = true, isAddPlugin = false) {
|
|
|
766
604
|
let placeholder = "";
|
|
767
605
|
const isPlugin = (inputs) => {
|
|
768
606
|
return (isAddPlugin ||
|
|
769
|
-
(!!inputs && inputs[
|
|
607
|
+
(!!inputs && inputs[constants_2.QuestionNames.ActionType] === constants_2.ActionStartOptions.apiSpec().id));
|
|
770
608
|
};
|
|
771
609
|
return {
|
|
772
610
|
type: "multiSelect",
|
|
773
|
-
name:
|
|
611
|
+
name: constants_2.QuestionNames.ApiOperation,
|
|
774
612
|
title: (inputs) => {
|
|
775
613
|
return isPlugin(inputs)
|
|
776
614
|
? (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.apiSpec.copilotOperation.title")
|
|
@@ -781,7 +619,7 @@ function apiOperationQuestion(includeExistingAPIs = true, isAddPlugin = false) {
|
|
|
781
619
|
: "Select operation(s) Teams can interact with.",
|
|
782
620
|
cliShortName: "o",
|
|
783
621
|
placeholder: (inputs) => {
|
|
784
|
-
const isPlugin = inputs[
|
|
622
|
+
const isPlugin = inputs[constants_2.QuestionNames.ActionType] === constants_2.ActionStartOptions.apiSpec().id;
|
|
785
623
|
if (!includeExistingAPIs) {
|
|
786
624
|
placeholder = (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.apiSpec.operation.placeholder.skipExisting");
|
|
787
625
|
}
|
|
@@ -802,9 +640,9 @@ function apiOperationQuestion(includeExistingAPIs = true, isAddPlugin = false) {
|
|
|
802
640
|
}
|
|
803
641
|
if (input.length < 1 ||
|
|
804
642
|
(input.length > 10 &&
|
|
805
|
-
inputs[
|
|
806
|
-
inputs[
|
|
807
|
-
inputs[
|
|
643
|
+
inputs[constants_2.QuestionNames.CustomCopilotRag] !== constants_2.CustomCopilotRagOptions.customApi().id &&
|
|
644
|
+
inputs[constants_2.QuestionNames.ProjectType] !== ProjectTypeOptions_1.ProjectTypeOptions.copilotAgentOptionId &&
|
|
645
|
+
inputs[constants_2.QuestionNames.ActionType] !== constants_2.ActionStartOptions.apiSpec().id)) {
|
|
808
646
|
return (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.apiSpec.operation.invalidMessage", input.length, 10);
|
|
809
647
|
}
|
|
810
648
|
const operations = inputs.supportedApisFromApiSpec;
|
|
@@ -836,9 +674,9 @@ function apiOperationQuestion(includeExistingAPIs = true, isAddPlugin = false) {
|
|
|
836
674
|
},
|
|
837
675
|
},
|
|
838
676
|
dynamicOptions: async (inputs) => {
|
|
839
|
-
if (inputs[
|
|
840
|
-
const specUrl = inputs[
|
|
841
|
-
inputs[
|
|
677
|
+
if (inputs[constants_2.QuestionNames.SelectOpenApiSpec]) {
|
|
678
|
+
const specUrl = inputs[constants_2.QuestionNames.SelectOpenApiSpec];
|
|
679
|
+
inputs[constants_2.QuestionNames.ApiSpecLocation] = specUrl;
|
|
842
680
|
const context = exports.createQuestionDeps.createContext();
|
|
843
681
|
// TODO: will use kiota npm package for this api
|
|
844
682
|
const res = await exports.createQuestionDeps.listOperations(context, specUrl, inputs, true, false);
|
|
@@ -850,7 +688,7 @@ function apiOperationQuestion(includeExistingAPIs = true, isAddPlugin = false) {
|
|
|
850
688
|
}
|
|
851
689
|
}
|
|
852
690
|
if (!inputs.supportedApisFromApiSpec) {
|
|
853
|
-
throw new
|
|
691
|
+
throw new error_1.EmptyOptionError(constants_2.QuestionNames.ApiOperation, "question");
|
|
854
692
|
}
|
|
855
693
|
const operations = inputs.supportedApisFromApiSpec;
|
|
856
694
|
return operations;
|
|
@@ -860,29 +698,29 @@ function apiOperationQuestion(includeExistingAPIs = true, isAddPlugin = false) {
|
|
|
860
698
|
function customCopilotRagQuestion() {
|
|
861
699
|
return {
|
|
862
700
|
type: "singleSelect",
|
|
863
|
-
name:
|
|
701
|
+
name: constants_2.QuestionNames.CustomCopilotRag,
|
|
864
702
|
title: (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.capability.customCopilotRag.title"),
|
|
865
703
|
placeholder: (0, localizeUtils_1.getLocalizedString)("template.teams.rag.source.placeholder"),
|
|
866
|
-
staticOptions:
|
|
867
|
-
dynamicOptions: () =>
|
|
868
|
-
default:
|
|
704
|
+
staticOptions: constants_2.CustomCopilotRagOptions.all(),
|
|
705
|
+
dynamicOptions: () => constants_2.CustomCopilotRagOptions.all(),
|
|
706
|
+
default: constants_2.CustomCopilotRagOptions.customize().id,
|
|
869
707
|
};
|
|
870
708
|
}
|
|
871
709
|
function customCopilotAssistantQuestion() {
|
|
872
710
|
return {
|
|
873
711
|
type: "singleSelect",
|
|
874
|
-
name:
|
|
712
|
+
name: constants_2.QuestionNames.CustomCopilotAssistant,
|
|
875
713
|
title: (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.capability.customCopilotAssistant.title"),
|
|
876
714
|
placeholder: (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.capability.customCopilotAssistant.placeholder"),
|
|
877
|
-
staticOptions:
|
|
878
|
-
dynamicOptions: () =>
|
|
879
|
-
default:
|
|
715
|
+
staticOptions: constants_2.CustomCopilotAssistantOptions.all(),
|
|
716
|
+
dynamicOptions: () => constants_2.CustomCopilotAssistantOptions.all(),
|
|
717
|
+
default: constants_2.CustomCopilotAssistantOptions.new().id,
|
|
880
718
|
};
|
|
881
719
|
}
|
|
882
720
|
function llmServiceQuestion() {
|
|
883
721
|
return {
|
|
884
722
|
type: "singleSelect",
|
|
885
|
-
name:
|
|
723
|
+
name: constants_2.QuestionNames.LLMService,
|
|
886
724
|
title: (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.llmService.title"),
|
|
887
725
|
placeholder: (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.llmService.placeholder"),
|
|
888
726
|
staticOptions: [
|
|
@@ -919,7 +757,7 @@ function openAIKeyQuestion() {
|
|
|
919
757
|
return {
|
|
920
758
|
type: "text",
|
|
921
759
|
password: true,
|
|
922
|
-
name:
|
|
760
|
+
name: constants_2.QuestionNames.OpenAIKey,
|
|
923
761
|
title: (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.llmService.openAIKey.title"),
|
|
924
762
|
placeholder: (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.llmService.openAIKey.placeholder"),
|
|
925
763
|
};
|
|
@@ -928,7 +766,7 @@ function azureOpenAIKeyQuestion() {
|
|
|
928
766
|
return {
|
|
929
767
|
type: "text",
|
|
930
768
|
password: true,
|
|
931
|
-
name:
|
|
769
|
+
name: constants_2.QuestionNames.AzureOpenAIKey,
|
|
932
770
|
title: (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.llmService.azureOpenAIKey.title"),
|
|
933
771
|
placeholder: (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.llmService.azureOpenAIKey.placeholder"),
|
|
934
772
|
};
|
|
@@ -936,7 +774,7 @@ function azureOpenAIKeyQuestion() {
|
|
|
936
774
|
function azureOpenAIEndpointQuestion() {
|
|
937
775
|
return {
|
|
938
776
|
type: "text",
|
|
939
|
-
name:
|
|
777
|
+
name: constants_2.QuestionNames.AzureOpenAIEndpoint,
|
|
940
778
|
title: (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.llmService.azureOpenAIEndpoint.title"),
|
|
941
779
|
placeholder: (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.llmService.azureOpenAIEndpoint.placeholder"),
|
|
942
780
|
};
|
|
@@ -944,7 +782,7 @@ function azureOpenAIEndpointQuestion() {
|
|
|
944
782
|
function azureOpenAIDeploymentNameQuestion() {
|
|
945
783
|
return {
|
|
946
784
|
type: "text",
|
|
947
|
-
name:
|
|
785
|
+
name: constants_2.QuestionNames.AzureOpenAIDeploymentName,
|
|
948
786
|
title: (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.llmService.azureOpenAIDeploymentName.title"),
|
|
949
787
|
placeholder: (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.llmService.azureOpenAIDeploymentName.placeholder"),
|
|
950
788
|
};
|
|
@@ -952,7 +790,7 @@ function azureOpenAIDeploymentNameQuestion() {
|
|
|
952
790
|
function openAIAssistantIdQuestion() {
|
|
953
791
|
return {
|
|
954
792
|
type: "text",
|
|
955
|
-
name:
|
|
793
|
+
name: constants_2.QuestionNames.OpenAIAssistantID,
|
|
956
794
|
title: (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.llmService.openAIAssistantID.title"),
|
|
957
795
|
placeholder: (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.llmService.openAIAssistantID.placeholder"),
|
|
958
796
|
};
|
|
@@ -960,7 +798,7 @@ function openAIAssistantIdQuestion() {
|
|
|
960
798
|
function azureOpenAIAssistantIdQuestion() {
|
|
961
799
|
return {
|
|
962
800
|
type: "text",
|
|
963
|
-
name:
|
|
801
|
+
name: constants_2.QuestionNames.AzureOpenAIAssistantId,
|
|
964
802
|
title: (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.llmService.azureOpenAIAssistantID.title"),
|
|
965
803
|
placeholder: (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.llmService.azureOpenAIAssistantID.placeholder"),
|
|
966
804
|
};
|
|
@@ -968,7 +806,7 @@ function azureOpenAIAssistantIdQuestion() {
|
|
|
968
806
|
function azureOpenAIEmbeddingDeploymentNameQuestion() {
|
|
969
807
|
return {
|
|
970
808
|
type: "text",
|
|
971
|
-
name:
|
|
809
|
+
name: constants_2.QuestionNames.AzureOpenAIEmbeddingDeploymentName,
|
|
972
810
|
title: (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.llmService.azureOpenAIEmbeddingDeploymentName.title"),
|
|
973
811
|
placeholder: (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.llmService.azureOpenAIEmbeddingDeploymentName.placeholder"),
|
|
974
812
|
};
|
|
@@ -976,7 +814,7 @@ function azureOpenAIEmbeddingDeploymentNameQuestion() {
|
|
|
976
814
|
function foundryEndpointQuestion() {
|
|
977
815
|
return {
|
|
978
816
|
type: "text",
|
|
979
|
-
name:
|
|
817
|
+
name: constants_2.QuestionNames.FoundryEndpoint,
|
|
980
818
|
title: (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.foundry.endpoint.title"),
|
|
981
819
|
placeholder: (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.foundry.endpoint.placeholder"),
|
|
982
820
|
};
|
|
@@ -984,7 +822,7 @@ function foundryEndpointQuestion() {
|
|
|
984
822
|
function foundryAgentIdQuestion() {
|
|
985
823
|
return {
|
|
986
824
|
type: "text",
|
|
987
|
-
name:
|
|
825
|
+
name: constants_2.QuestionNames.FoundryAgentId,
|
|
988
826
|
title: (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.foundry.agentId.title"),
|
|
989
827
|
placeholder: (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.foundry.agentId.placeholder"),
|
|
990
828
|
};
|
|
@@ -992,36 +830,36 @@ function foundryAgentIdQuestion() {
|
|
|
992
830
|
function apiPluginStartQuestion(doesProjectExists) {
|
|
993
831
|
return {
|
|
994
832
|
type: "singleSelect",
|
|
995
|
-
name:
|
|
833
|
+
name: constants_2.QuestionNames.ActionType,
|
|
996
834
|
title: (inputs) => {
|
|
997
|
-
return inputs[
|
|
835
|
+
return inputs[constants_2.QuestionNames.Capabilities] === CapabilityOptions_1.DACapabilityOptions.declarativeAgent().id ||
|
|
998
836
|
doesProjectExists
|
|
999
837
|
? (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.addApiPlugin.title")
|
|
1000
838
|
: (0, localizeUtils_1.getLocalizedString)("template.createProjectQuestion.createApiPlugin.title");
|
|
1001
839
|
},
|
|
1002
840
|
placeholder: (inputs) => {
|
|
1003
|
-
return inputs[
|
|
841
|
+
return inputs[constants_2.QuestionNames.Capabilities] === CapabilityOptions_1.DACapabilityOptions.declarativeAgent().id ||
|
|
1004
842
|
doesProjectExists
|
|
1005
843
|
? (0, localizeUtils_1.getLocalizedString)("template.createProjectQuestion.addApiPlugin.placeholder")
|
|
1006
844
|
: (0, localizeUtils_1.getLocalizedString)("template.createProjectQuestion.projectType.copilotExtension.placeholder");
|
|
1007
845
|
},
|
|
1008
846
|
cliDescription: "Action type.",
|
|
1009
|
-
staticOptions:
|
|
847
|
+
staticOptions: constants_2.ActionStartOptions.staticAll(doesProjectExists),
|
|
1010
848
|
dynamicOptions: (inputs) => {
|
|
1011
|
-
return
|
|
849
|
+
return constants_2.ActionStartOptions.all(inputs, doesProjectExists);
|
|
1012
850
|
},
|
|
1013
|
-
default:
|
|
851
|
+
default: constants_2.ActionStartOptions.newApi().id,
|
|
1014
852
|
};
|
|
1015
853
|
}
|
|
1016
854
|
function selectExistingPluginManifestQuestion() {
|
|
1017
855
|
return {
|
|
1018
856
|
type: "singleSelect",
|
|
1019
|
-
name:
|
|
857
|
+
name: constants_2.QuestionNames.SelectPluginManifest,
|
|
1020
858
|
title: (0, localizeUtils_1.getLocalizedString)("core.regenerateQuestion.selectPluginManifestTitle"),
|
|
1021
859
|
cliDescription: "Select plugin manifest file.",
|
|
1022
860
|
staticOptions: [],
|
|
1023
861
|
onDidSelection: (item, inputs) => {
|
|
1024
|
-
inputs[
|
|
862
|
+
inputs[constants_2.QuestionNames.SelectPluginId] = item.data;
|
|
1025
863
|
},
|
|
1026
864
|
dynamicOptions: async (inputs) => {
|
|
1027
865
|
if (!inputs.projectPath) {
|
|
@@ -1029,7 +867,7 @@ function selectExistingPluginManifestQuestion() {
|
|
|
1029
867
|
}
|
|
1030
868
|
const options = [];
|
|
1031
869
|
const manifestPath = path.join(inputs.projectPath, teamsfx_api_1.AppPackageFolderName, teamsfx_api_1.ManifestTemplateFileName);
|
|
1032
|
-
inputs[
|
|
870
|
+
inputs[constants_2.QuestionNames.ManifestPath] = manifestPath;
|
|
1033
871
|
const manifestRes = await ManifestUtils_1.manifestUtils._readAppManifest(manifestPath);
|
|
1034
872
|
if (manifestRes.isErr()) {
|
|
1035
873
|
throw manifestRes.error;
|
|
@@ -1037,13 +875,13 @@ function selectExistingPluginManifestQuestion() {
|
|
|
1037
875
|
const manifest = manifestRes.value;
|
|
1038
876
|
const declarativeAgentPathRelativePath = manifest?.copilotAgents?.declarativeAgents?.[0]?.file;
|
|
1039
877
|
if (!declarativeAgentPathRelativePath) {
|
|
1040
|
-
throw new
|
|
878
|
+
throw new error_1.DeclarativeAgentPathNotFoundError(manifestPath);
|
|
1041
879
|
}
|
|
1042
880
|
const declarativeAgentPath = path.join(inputs.projectPath, teamsfx_api_1.AppPackageFolderName, declarativeAgentPathRelativePath);
|
|
1043
881
|
const declarativeAgentJson = (await fs_extra_1.default.readJSON(declarativeAgentPath));
|
|
1044
882
|
const actions = declarativeAgentJson.actions;
|
|
1045
883
|
if (!actions || actions.length === 0) {
|
|
1046
|
-
throw new
|
|
884
|
+
throw new error_1.ActionNotFoundError(declarativeAgentPath);
|
|
1047
885
|
}
|
|
1048
886
|
for (const action of actions) {
|
|
1049
887
|
const actionName = action.file;
|
|
@@ -1060,17 +898,17 @@ function selectExistingPluginManifestQuestion() {
|
|
|
1060
898
|
function selectOpenAPISpecFromPluginQuestion() {
|
|
1061
899
|
return {
|
|
1062
900
|
type: "singleSelect",
|
|
1063
|
-
name:
|
|
901
|
+
name: constants_2.QuestionNames.SelectOpenAPISpecFromPlugin,
|
|
1064
902
|
title: (0, localizeUtils_1.getLocalizedString)("core.regenerateQuestion.selectOpenAPISpecFromPluginTitle"),
|
|
1065
903
|
cliDescription: "Select OpenAPI description document file.",
|
|
1066
904
|
staticOptions: [],
|
|
1067
905
|
onDidSelection: (itemOrId, inputs) => {
|
|
1068
|
-
inputs[
|
|
906
|
+
inputs[constants_2.QuestionNames.ActionType] = constants_2.DeclarativeAgentApiSpecOptionId;
|
|
1069
907
|
},
|
|
1070
908
|
dynamicOptions: async (inputs) => {
|
|
1071
|
-
const pluginPath = inputs[
|
|
909
|
+
const pluginPath = inputs[constants_2.QuestionNames.SelectPluginManifest];
|
|
1072
910
|
const options = [];
|
|
1073
|
-
const pluginManifest = await fs_extra_1.default.readJSON(inputs[
|
|
911
|
+
const pluginManifest = await fs_extra_1.default.readJSON(inputs[constants_2.QuestionNames.SelectPluginManifest]);
|
|
1074
912
|
const specUrlMap = new Map();
|
|
1075
913
|
pluginManifest.runtimes?.forEach((runtime) => {
|
|
1076
914
|
if (runtime.spec) {
|
|
@@ -1095,7 +933,7 @@ function selectOpenAPISpecFromPluginQuestion() {
|
|
|
1095
933
|
});
|
|
1096
934
|
});
|
|
1097
935
|
if (options.length === 0) {
|
|
1098
|
-
throw new
|
|
936
|
+
throw new error_1.SpecNotFoundError(pluginPath);
|
|
1099
937
|
}
|
|
1100
938
|
return options;
|
|
1101
939
|
},
|
|
@@ -1104,7 +942,7 @@ function selectOpenAPISpecFromPluginQuestion() {
|
|
|
1104
942
|
function selectApiOperationForRegenerateQuestion() {
|
|
1105
943
|
return {
|
|
1106
944
|
type: "multiSelect",
|
|
1107
|
-
name:
|
|
945
|
+
name: constants_2.QuestionNames.ApiOperation,
|
|
1108
946
|
title: (0, localizeUtils_1.getLocalizedString)("core.regenerateQuestion.selectApiOperationForRegenerateTitle"),
|
|
1109
947
|
cliDescription: "Select operation(s) Copilot can interact with.",
|
|
1110
948
|
cliShortName: "o",
|
|
@@ -1127,11 +965,11 @@ function selectApiOperationForRegenerateQuestion() {
|
|
|
1127
965
|
},
|
|
1128
966
|
},
|
|
1129
967
|
dynamicOptions: async (inputs) => {
|
|
1130
|
-
const specUrl = inputs[
|
|
968
|
+
const specUrl = inputs[constants_2.QuestionNames.SelectOpenAPISpecFromPlugin] + ".original";
|
|
1131
969
|
if (!(await fs_extra_1.default.pathExists(specUrl))) {
|
|
1132
|
-
throw new
|
|
970
|
+
throw new error_1.OriginalSpecNotFoundError(specUrl);
|
|
1133
971
|
}
|
|
1134
|
-
inputs[
|
|
972
|
+
inputs[constants_2.QuestionNames.ApiSpecLocation] = specUrl;
|
|
1135
973
|
const context = exports.createQuestionDeps.createContext();
|
|
1136
974
|
const res = await exports.createQuestionDeps.listOperations(context, specUrl, inputs, true, false);
|
|
1137
975
|
if (res.isOk()) {
|
|
@@ -1142,7 +980,7 @@ function selectApiOperationForRegenerateQuestion() {
|
|
|
1142
980
|
throw new teamsfx_api_1.UserError("FxCore", "ListOpenAPISpecOperationsError", message, message);
|
|
1143
981
|
}
|
|
1144
982
|
if (!inputs.supportedApisFromApiSpec || inputs.supportedApisFromApiSpec.length === 0) {
|
|
1145
|
-
throw new
|
|
983
|
+
throw new error_1.EmptyOptionError(constants_2.QuestionNames.ApiOperation, "question");
|
|
1146
984
|
}
|
|
1147
985
|
const operations = inputs.supportedApisFromApiSpec;
|
|
1148
986
|
return operations;
|
|
@@ -1153,7 +991,7 @@ function pluginManifestQuestion() {
|
|
|
1153
991
|
const correlationId = correlator_1.Correlator.getId();
|
|
1154
992
|
return {
|
|
1155
993
|
type: "singleFile",
|
|
1156
|
-
name:
|
|
994
|
+
name: constants_2.QuestionNames.PluginManifestFilePath,
|
|
1157
995
|
title: (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.addExistingPlugin.pluginManifest.title"),
|
|
1158
996
|
placeholder: (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.addExistingPlugin.pluginManifest.placeholder"),
|
|
1159
997
|
cliDescription: "Plugin manifest path.",
|
|
@@ -1175,16 +1013,16 @@ function pluginManifestQuestion() {
|
|
|
1175
1013
|
validFunc: async (input) => {
|
|
1176
1014
|
const manifestRes = await PluginManifestUtils_1.pluginManifestUtils.readPluginManifestFile(input.trim());
|
|
1177
1015
|
if (manifestRes.isErr()) {
|
|
1178
|
-
(0, telemetry_1.sendTelemetryErrorEvent)(
|
|
1016
|
+
(0, telemetry_1.sendTelemetryErrorEvent)(error_1.CoreSource, (0, telemetry_1.getQuestionValidationErrorEventName)(constants_2.QuestionNames.PluginManifestFilePath), manifestRes.error, {
|
|
1179
1017
|
"correlation-id": correlationId,
|
|
1180
1018
|
});
|
|
1181
1019
|
return manifestRes.error.displayMessage;
|
|
1182
1020
|
}
|
|
1183
1021
|
else {
|
|
1184
1022
|
const manifest = manifestRes.value;
|
|
1185
|
-
const checkRes = (0, helper_1.validateSourcePluginManifest)(manifest,
|
|
1023
|
+
const checkRes = (0, helper_1.validateSourcePluginManifest)(manifest, constants_2.QuestionNames.PluginManifestFilePath);
|
|
1186
1024
|
if (checkRes.isErr()) {
|
|
1187
|
-
(0, telemetry_1.sendTelemetryErrorEvent)(
|
|
1025
|
+
(0, telemetry_1.sendTelemetryErrorEvent)(error_1.CoreSource, (0, telemetry_1.getQuestionValidationErrorEventName)(constants_2.QuestionNames.PluginManifestFilePath), checkRes.error, {
|
|
1188
1026
|
"correlation-id": correlationId,
|
|
1189
1027
|
});
|
|
1190
1028
|
return checkRes.error.displayMessage;
|
|
@@ -1198,7 +1036,7 @@ function pluginApiSpecQuestion() {
|
|
|
1198
1036
|
const correlationId = correlator_1.Correlator.getId();
|
|
1199
1037
|
return {
|
|
1200
1038
|
type: "singleFile",
|
|
1201
|
-
name:
|
|
1039
|
+
name: constants_2.QuestionNames.PluginOpenApiSpecFilePath,
|
|
1202
1040
|
title: (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.addExistingPlugin.apiSpec.title"),
|
|
1203
1041
|
placeholder: (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.addExistingPlugin.openApiSpec.placeholder"),
|
|
1204
1042
|
cliDescription: "OpenAPI description document used for your API plugin.",
|
|
@@ -1207,7 +1045,7 @@ function pluginApiSpecQuestion() {
|
|
|
1207
1045
|
},
|
|
1208
1046
|
defaultFolder: (inputs) => teamsfx_api_1.CLIPlatforms.includes(inputs.platform)
|
|
1209
1047
|
? "./"
|
|
1210
|
-
: path.dirname(inputs[
|
|
1048
|
+
: path.dirname(inputs[constants_2.QuestionNames.PluginManifestFilePath]),
|
|
1211
1049
|
validation: {
|
|
1212
1050
|
validFunc: async (input, inputs) => {
|
|
1213
1051
|
if (!inputs) {
|
|
@@ -1216,8 +1054,8 @@ function pluginApiSpecQuestion() {
|
|
|
1216
1054
|
const filePath = input.trim();
|
|
1217
1055
|
const ext = path.extname(filePath).toLowerCase();
|
|
1218
1056
|
if (![".json", ".yml", ".yaml"].includes(ext)) {
|
|
1219
|
-
const error = new
|
|
1220
|
-
(0, telemetry_1.sendTelemetryErrorEvent)(
|
|
1057
|
+
const error = new error_1.FileNotSupportError(error_1.CoreSource, ["json", "yml", "yaml"].join(", "));
|
|
1058
|
+
(0, telemetry_1.sendTelemetryErrorEvent)(error_1.CoreSource, (0, telemetry_1.getQuestionValidationErrorEventName)(constants_2.QuestionNames.PluginOpenApiSpecFilePath), error, {
|
|
1221
1059
|
"correlation-id": correlationId,
|
|
1222
1060
|
});
|
|
1223
1061
|
return error.displayMessage;
|
|
@@ -1226,7 +1064,7 @@ function pluginApiSpecQuestion() {
|
|
|
1226
1064
|
const invalidSpecError = validationRes.errors.find((o) => o.type === m365_spec_parser_1.ErrorType.SpecNotValid);
|
|
1227
1065
|
if (invalidSpecError) {
|
|
1228
1066
|
const error = new teamsfx_api_1.UserError(constants_1.SpecParserSource, telemetry_1.ApiSpecTelemetryPropertis.InvalidApiSpec, invalidSpecError.content, invalidSpecError.content);
|
|
1229
|
-
(0, telemetry_1.sendTelemetryErrorEvent)(
|
|
1067
|
+
(0, telemetry_1.sendTelemetryErrorEvent)(error_1.CoreSource, (0, telemetry_1.getQuestionValidationErrorEventName)(constants_2.QuestionNames.PluginOpenApiSpecFilePath), error, {
|
|
1230
1068
|
"correlation-id": correlationId,
|
|
1231
1069
|
[telemetry_1.ApiSpecTelemetryPropertis.SpecNotValidDetails]: invalidSpecError.content,
|
|
1232
1070
|
});
|
|
@@ -1239,15 +1077,15 @@ function pluginApiSpecQuestion() {
|
|
|
1239
1077
|
function addKnowledgeStartQuestion(doesProjectExists) {
|
|
1240
1078
|
return {
|
|
1241
1079
|
type: "singleSelect",
|
|
1242
|
-
name:
|
|
1080
|
+
name: constants_2.QuestionNames.KnowledgeSource,
|
|
1243
1081
|
title: (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.addKnowledge.title"),
|
|
1244
1082
|
placeholder: (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.addKnowledge.placeholder"),
|
|
1245
1083
|
cliDescription: "Knowledge source.",
|
|
1246
|
-
staticOptions:
|
|
1247
|
-
default:
|
|
1084
|
+
staticOptions: constants_2.KnowledgeSourceOptions.all(),
|
|
1085
|
+
default: constants_2.KnowledgeSourceOptions.webSearch().id,
|
|
1248
1086
|
required: true,
|
|
1249
1087
|
dynamicOptions: (inputs) => {
|
|
1250
|
-
return
|
|
1088
|
+
return constants_2.KnowledgeSourceOptions.allWithFeatureFlags();
|
|
1251
1089
|
},
|
|
1252
1090
|
};
|
|
1253
1091
|
}
|
|
@@ -1267,13 +1105,13 @@ function oneDriveSharePointItemQuestion() {
|
|
|
1267
1105
|
}
|
|
1268
1106
|
}
|
|
1269
1107
|
catch (e) {
|
|
1270
|
-
const error = (0,
|
|
1108
|
+
const error = (0, error_1.assembleError)(e);
|
|
1271
1109
|
throw error;
|
|
1272
1110
|
}
|
|
1273
1111
|
};
|
|
1274
1112
|
return {
|
|
1275
1113
|
type: "text",
|
|
1276
|
-
name:
|
|
1114
|
+
name: constants_2.QuestionNames.OneDriveSharePointURL,
|
|
1277
1115
|
title: (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.oneDriveSharePointItem.title"),
|
|
1278
1116
|
forgetLastValue: true,
|
|
1279
1117
|
additionalValidationOnAccept: {
|
|
@@ -1289,7 +1127,7 @@ function oneDriveSharePointItemQuestion() {
|
|
|
1289
1127
|
}
|
|
1290
1128
|
function oneDriveSharePointItemConfirmQuestion() {
|
|
1291
1129
|
return {
|
|
1292
|
-
name:
|
|
1130
|
+
name: constants_2.QuestionNames.OneDriveSharePointContent,
|
|
1293
1131
|
title: (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.oneDriveSharePointItem.title"),
|
|
1294
1132
|
type: "singleSelect",
|
|
1295
1133
|
staticOptions: [],
|
|
@@ -1309,9 +1147,9 @@ function oneDriveSharePointItemConfirmQuestion() {
|
|
|
1309
1147
|
};
|
|
1310
1148
|
}
|
|
1311
1149
|
function GCItemQuestion() {
|
|
1312
|
-
const options = [
|
|
1150
|
+
const options = [constants_2.GCSelectOptions.list(), constants_2.GCSelectOptions.input()];
|
|
1313
1151
|
return {
|
|
1314
|
-
name:
|
|
1152
|
+
name: constants_2.QuestionNames.GCContent,
|
|
1315
1153
|
title: (0, localizeUtils_1.getLocalizedString)("core.GCSelectQuestion.title"),
|
|
1316
1154
|
staticOptions: options,
|
|
1317
1155
|
type: "singleSelect",
|
|
@@ -1320,7 +1158,7 @@ function GCItemQuestion() {
|
|
|
1320
1158
|
function GCListQuestion() {
|
|
1321
1159
|
return {
|
|
1322
1160
|
type: "multiSelect",
|
|
1323
|
-
name:
|
|
1161
|
+
name: constants_2.QuestionNames.GCList,
|
|
1324
1162
|
title: (0, localizeUtils_1.getLocalizedString)("core.GCListQuestion.title"),
|
|
1325
1163
|
staticOptions: [],
|
|
1326
1164
|
dynamicOptions: helper_1.getGraphConnectors,
|
|
@@ -1332,8 +1170,8 @@ function GCListQuestion() {
|
|
|
1332
1170
|
if (!inputs) {
|
|
1333
1171
|
throw new Error("inputs is undefined"); // should never happen
|
|
1334
1172
|
}
|
|
1335
|
-
if (inputs[
|
|
1336
|
-
inputs[
|
|
1173
|
+
if (inputs[constants_2.QuestionNames.KnowledgeSource] == constants_2.KnowledgeSourceOptions.graphConnector().id &&
|
|
1174
|
+
inputs[constants_2.QuestionNames.GCContent] == constants_2.GCSelectOptions.list().id &&
|
|
1337
1175
|
input.length < 1) {
|
|
1338
1176
|
return Promise.resolve((0, localizeUtils_1.getLocalizedString)("core.GCListQuestion.invalidMessage", input.length));
|
|
1339
1177
|
}
|
|
@@ -1344,7 +1182,7 @@ function GCListQuestion() {
|
|
|
1344
1182
|
function GCInputQuestion() {
|
|
1345
1183
|
return {
|
|
1346
1184
|
type: "text",
|
|
1347
|
-
name:
|
|
1185
|
+
name: constants_2.QuestionNames.GCInput,
|
|
1348
1186
|
title: (0, localizeUtils_1.getLocalizedString)("core.GCInputQuestion.title"),
|
|
1349
1187
|
cliDescription: "a connection ID for Copilot connector",
|
|
1350
1188
|
forgetLastValue: true,
|
|
@@ -1359,7 +1197,7 @@ function GCInputQuestion() {
|
|
|
1359
1197
|
}
|
|
1360
1198
|
function webContentQuestion() {
|
|
1361
1199
|
return {
|
|
1362
|
-
name:
|
|
1200
|
+
name: constants_2.QuestionNames.WebContent,
|
|
1363
1201
|
title: (0, localizeUtils_1.getLocalizedString)("core.addKnowledgeQuestion.webContent.title"),
|
|
1364
1202
|
placeholder: (0, localizeUtils_1.getLocalizedString)("core.addKnowledgeQuestion.webContent.placeholder"),
|
|
1365
1203
|
type: "text",
|
|
@@ -1382,19 +1220,19 @@ function webContentQuestion() {
|
|
|
1382
1220
|
}
|
|
1383
1221
|
function searchTypeQuestion() {
|
|
1384
1222
|
return {
|
|
1385
|
-
name:
|
|
1223
|
+
name: constants_2.QuestionNames.SearchType,
|
|
1386
1224
|
title: (0, localizeUtils_1.getLocalizedString)("core.addKnowledgeQuestion.searchType.title"),
|
|
1387
|
-
staticOptions:
|
|
1225
|
+
staticOptions: constants_2.KnowledgeSearchTypeOptions.all(),
|
|
1388
1226
|
type: "singleSelect",
|
|
1389
1227
|
required: true,
|
|
1390
|
-
default:
|
|
1228
|
+
default: constants_2.KnowledgeSearchTypeOptions.url().id,
|
|
1391
1229
|
dynamicOptions: (inputs) => {
|
|
1392
|
-
const options = [
|
|
1393
|
-
if (inputs[
|
|
1394
|
-
options.push(
|
|
1230
|
+
const options = [constants_2.KnowledgeSearchTypeOptions.url()];
|
|
1231
|
+
if (inputs[constants_2.QuestionNames.KnowledgeSource] === constants_2.KnowledgeSourceOptions.webSearch().id) {
|
|
1232
|
+
options.push(constants_2.KnowledgeSearchTypeOptions.allWeb());
|
|
1395
1233
|
}
|
|
1396
|
-
else if (inputs[
|
|
1397
|
-
options.push(
|
|
1234
|
+
else if (inputs[constants_2.QuestionNames.KnowledgeSource] === constants_2.KnowledgeSourceOptions.oneDriveSharePoint().id) {
|
|
1235
|
+
options.push(constants_2.KnowledgeSearchTypeOptions.allOneDriveSharepoint());
|
|
1398
1236
|
}
|
|
1399
1237
|
return options;
|
|
1400
1238
|
},
|
|
@@ -1403,19 +1241,19 @@ function searchTypeQuestion() {
|
|
|
1403
1241
|
function GCNameQuestion() {
|
|
1404
1242
|
return {
|
|
1405
1243
|
type: "text",
|
|
1406
|
-
name:
|
|
1244
|
+
name: constants_2.QuestionNames.GCName,
|
|
1407
1245
|
title: (0, localizeUtils_1.getLocalizedString)("core.GCNameQuestion.title"),
|
|
1408
1246
|
placeholder: (0, localizeUtils_1.getLocalizedString)("core.GCNameQuestion.placeholder"),
|
|
1409
1247
|
cliDescription: "a name for Copilot connector",
|
|
1410
1248
|
forgetLastValue: true,
|
|
1411
1249
|
additionalValidationOnAccept: {
|
|
1412
1250
|
validFunc: (input, inputs) => {
|
|
1413
|
-
inputs = (0,
|
|
1414
|
-
inputs[
|
|
1251
|
+
inputs = (0, utils_2.ensureInputs)(inputs);
|
|
1252
|
+
inputs[constants_2.QuestionNames.ProgrammingLanguage] = constants_2.ProgrammingLanguage.TS;
|
|
1415
1253
|
// Set template name and app name for Copilot connector Template
|
|
1416
|
-
if (inputs[
|
|
1417
|
-
inputs[
|
|
1418
|
-
inputs[
|
|
1254
|
+
if (inputs[constants_2.QuestionNames.ProjectType] !== ProjectTypeOptions_1.ProjectTypeOptions.copilotAgentOptionId) {
|
|
1255
|
+
inputs[constants_2.QuestionNames.TemplateName] = templateNames_1.TemplateNames.GraphConnector;
|
|
1256
|
+
inputs[constants_2.QuestionNames.AppName] = input;
|
|
1419
1257
|
}
|
|
1420
1258
|
return;
|
|
1421
1259
|
},
|
|
@@ -1425,8 +1263,8 @@ function GCNameQuestion() {
|
|
|
1425
1263
|
if (!input || input.trim().length === 0) {
|
|
1426
1264
|
return "Please enter a Copilot connector name.";
|
|
1427
1265
|
}
|
|
1428
|
-
inputs = (0,
|
|
1429
|
-
if (inputs[
|
|
1266
|
+
inputs = (0, utils_2.ensureInputs)(inputs);
|
|
1267
|
+
if (inputs[constants_2.QuestionNames.ProjectType] !== ProjectTypeOptions_1.ProjectTypeOptions.copilotAgentOptionId) {
|
|
1430
1268
|
// Copilot connector Template will use the name as app name, which has a minimum length of 2.
|
|
1431
1269
|
if (input.trim().length < 2) {
|
|
1432
1270
|
return "Please enter a Copilot connector name with minimum two characters.";
|
|
@@ -1440,7 +1278,7 @@ function GCNameQuestion() {
|
|
|
1440
1278
|
function GCConnectionIdQuestion() {
|
|
1441
1279
|
return {
|
|
1442
1280
|
type: "text",
|
|
1443
|
-
name:
|
|
1281
|
+
name: constants_2.QuestionNames.GCConnectionId,
|
|
1444
1282
|
title: (0, localizeUtils_1.getLocalizedString)("core.GCConnectionIdQuestion.title"),
|
|
1445
1283
|
placeholder: (0, localizeUtils_1.getLocalizedString)("core.GCConnectionIdQuestion.placeholder"),
|
|
1446
1284
|
cliDescription: "a connection id for Copilot connector",
|