@microsoft/teamsfx-core 3.0.0-alpha.e2e4e5205.0 → 3.0.0-alpha.e3f6ce706.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/client/graphClient.d.ts +6 -1
- package/build/client/graphClient.d.ts.map +1 -1
- package/build/client/graphClient.js +49 -18
- package/build/client/graphClient.js.map +1 -1
- package/build/common/daSpecParser.d.ts +1 -1
- package/build/common/daSpecParser.d.ts.map +1 -1
- package/build/common/daSpecParser.js +44 -21
- package/build/common/daSpecParser.js.map +1 -1
- package/build/common/featureFlags.d.ts +0 -5
- package/build/common/featureFlags.d.ts.map +1 -1
- package/build/common/featureFlags.js +0 -5
- package/build/common/featureFlags.js.map +1 -1
- package/build/common/templates-config.json +1 -1
- package/build/common/wrappedAxiosClient.d.ts.map +1 -1
- package/build/common/wrappedAxiosClient.js +3 -0
- package/build/common/wrappedAxiosClient.js.map +1 -1
- package/build/component/coordinator/index.d.ts.map +1 -1
- package/build/component/coordinator/index.js +5 -6
- package/build/component/coordinator/index.js.map +1 -1
- package/build/component/driver/teamsApp/createAppPackage.d.ts.map +1 -1
- package/build/component/driver/teamsApp/createAppPackage.js +4 -4
- package/build/component/driver/teamsApp/createAppPackage.js.map +1 -1
- package/build/component/driver/teamsApp/utils/ManifestUtils.d.ts.map +1 -1
- package/build/component/driver/teamsApp/utils/ManifestUtils.js +29 -29
- package/build/component/driver/teamsApp/utils/ManifestUtils.js.map +1 -1
- package/build/component/driver/typeSpec/compile.d.ts.map +1 -1
- package/build/component/driver/typeSpec/compile.js +1 -2
- package/build/component/driver/typeSpec/compile.js.map +1 -1
- package/build/component/generator/combinedProject/generator.d.ts.map +1 -1
- package/build/component/generator/combinedProject/generator.js +1 -1
- package/build/component/generator/combinedProject/generator.js.map +1 -1
- package/build/component/generator/openApiSpec/helper.d.ts +1 -1
- package/build/component/generator/openApiSpec/helper.d.ts.map +1 -1
- package/build/component/generator/openApiSpec/helper.js +4 -3
- package/build/component/generator/openApiSpec/helper.js.map +1 -1
- package/build/component/m365/serviceConstant.d.ts.map +1 -1
- package/build/component/m365/serviceConstant.js +10 -0
- package/build/component/m365/serviceConstant.js.map +1 -1
- package/build/component/migrate.d.ts.map +1 -1
- package/build/component/migrate.js +1 -2
- package/build/component/migrate.js.map +1 -1
- package/build/core/FxCore.d.ts +6 -1
- package/build/core/FxCore.d.ts.map +1 -1
- package/build/core/FxCore.js +106 -4
- package/build/core/FxCore.js.map +1 -1
- package/build/core/middleware/retry.d.ts +3 -0
- package/build/core/middleware/retry.d.ts.map +1 -0
- package/build/core/middleware/retry.js +30 -0
- package/build/core/middleware/retry.js.map +1 -0
- package/build/error/common.d.ts +15 -0
- package/build/error/common.d.ts.map +1 -1
- package/build/error/common.js +57 -1
- package/build/error/common.js.map +1 -1
- package/build/index.d.ts +3 -0
- package/build/index.d.ts.map +1 -1
- package/build/index.js +17 -4
- package/build/index.js.map +1 -1
- package/build/question/constants.d.ts +2 -206
- package/build/question/constants.d.ts.map +1 -1
- package/build/question/constants.js +6 -683
- package/build/question/constants.js.map +1 -1
- package/build/question/create.d.ts +4 -9
- package/build/question/create.d.ts.map +1 -1
- package/build/question/create.js +159 -555
- package/build/question/create.js.map +1 -1
- package/build/question/index.d.ts +1 -0
- package/build/question/index.d.ts.map +1 -1
- package/build/question/index.js +3 -1
- package/build/question/index.js.map +1 -1
- package/build/question/other.d.ts +1 -0
- package/build/question/other.d.ts.map +1 -1
- package/build/question/other.js +16 -2
- package/build/question/other.js.map +1 -1
- package/build/question/questionNames.d.ts +131 -0
- package/build/question/questionNames.d.ts.map +1 -0
- package/build/question/questionNames.js +137 -0
- package/build/question/questionNames.js.map +1 -0
- package/build/question/scaffold/vs/createRootNode.d.ts +1 -0
- package/build/question/scaffold/vs/createRootNode.d.ts.map +1 -1
- package/build/question/scaffold/vs/createRootNode.js +14 -6
- package/build/question/scaffold/vs/createRootNode.js.map +1 -1
- package/build/question/scaffold/vsc/CapabilityOptions.d.ts +6 -1
- package/build/question/scaffold/vsc/CapabilityOptions.d.ts.map +1 -1
- package/build/question/scaffold/vsc/CapabilityOptions.js +43 -14
- package/build/question/scaffold/vsc/CapabilityOptions.js.map +1 -1
- package/build/question/scaffold/vsc/ProjectTypeOptions.d.ts +4 -1
- package/build/question/scaffold/vsc/ProjectTypeOptions.d.ts.map +1 -1
- package/build/question/scaffold/vsc/ProjectTypeOptions.js +15 -11
- package/build/question/scaffold/vsc/ProjectTypeOptions.js.map +1 -1
- package/build/question/scaffold/vsc/agentForTeamsNode.js +11 -11
- package/build/question/scaffold/vsc/agentForTeamsNode.js.map +1 -1
- package/build/question/scaffold/vsc/createFromTdpNode.d.ts +1 -7
- package/build/question/scaffold/vsc/createFromTdpNode.d.ts.map +1 -1
- package/build/question/scaffold/vsc/createFromTdpNode.js +11 -45
- package/build/question/scaffold/vsc/createFromTdpNode.js.map +1 -1
- package/build/question/scaffold/vsc/createRootNode.d.ts.map +1 -1
- package/build/question/scaffold/vsc/createRootNode.js +26 -11
- package/build/question/scaffold/vsc/createRootNode.js.map +1 -1
- package/build/question/scaffold/vsc/customEngineAgentNode.js +2 -2
- package/build/question/scaffold/vsc/customEngineAgentNode.js.map +1 -1
- package/build/question/scaffold/vsc/daProjectTypeNode.d.ts +2 -1
- package/build/question/scaffold/vsc/daProjectTypeNode.d.ts.map +1 -1
- package/build/question/scaffold/vsc/daProjectTypeNode.js +16 -22
- package/build/question/scaffold/vsc/daProjectTypeNode.js.map +1 -1
- package/build/question/scaffold/vsc/graphConnectorProjectTypeNode.d.ts.map +1 -1
- package/build/question/scaffold/vsc/graphConnectorProjectTypeNode.js +0 -1
- package/build/question/scaffold/vsc/graphConnectorProjectTypeNode.js.map +1 -1
- package/build/question/scaffold/vsc/officeAddinProjectTypeNode.js +9 -9
- package/build/question/scaffold/vsc/officeAddinProjectTypeNode.js.map +1 -1
- package/build/question/scaffold/vsc/teamsProjectTypeNode.js +14 -14
- package/build/question/scaffold/vsc/teamsProjectTypeNode.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/package.json +6 -4
- package/resource/package.nls.cs.json +87 -81
- package/resource/package.nls.de.json +87 -81
- package/resource/package.nls.es.json +87 -81
- package/resource/package.nls.fr.json +87 -81
- package/resource/package.nls.it.json +87 -81
- package/resource/package.nls.ja.json +87 -81
- package/resource/package.nls.json +13 -12
- package/resource/package.nls.ko.json +87 -81
- package/resource/package.nls.pl.json +79 -73
- package/resource/package.nls.pt-BR.json +87 -81
- package/resource/package.nls.ru.json +152 -146
- package/resource/package.nls.tr.json +87 -81
- package/resource/package.nls.zh-Hans.json +79 -73
- package/resource/package.nls.zh-Hant.json +87 -81
- package/templates/fallback/common.zip +0 -0
- package/templates/fallback/csharp.zip +0 -0
- package/templates/fallback/js.zip +0 -0
- package/templates/fallback/python.zip +0 -0
- package/templates/fallback/ts.zip +0 -0
- package/build/component/driver/typeSpec/error/reProvisionError.d.ts +0 -5
- package/build/component/driver/typeSpec/error/reProvisionError.d.ts.map +0 -1
- package/build/component/driver/typeSpec/error/reProvisionError.js +0 -21
- package/build/component/driver/typeSpec/error/reProvisionError.js.map +0 -1
package/build/question/create.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright (c) Microsoft Corporation.
|
|
3
3
|
// Licensed under the MIT license.
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.createSampleProjectQuestionNode = exports.
|
|
5
|
+
exports.createSampleProjectQuestionNode = exports.GCConnectionIdQuestion = exports.GCNameQuestion = exports.searchTypeQuestion = exports.webContentQuestion = exports.GCInputQuestion = exports.GCListQuestion = exports.GCItemQuestion = exports.oneDriveSharePointItemConfirmQuestion = exports.oneDriveSharePointItemQuestion = exports.addKnowledgeStartQuestion = exports.pluginApiSpecQuestion = exports.pluginManifestQuestion = exports.selectApiOperationForRegenerateQuestion = exports.selectOpenAPISpecFromPluginQuestion = exports.selectExistingPluginManifestQuestion = exports.apiPluginStartQuestion = exports.azureOpenAIDeploymentNameQuestion = exports.azureOpenAIEndpointQuestion = exports.azureOpenAIKeyQuestion = exports.openAIKeyQuestion = exports.apiOperationQuestion = exports.apiAuthQuestion = exports.apiSpecLocationQuestion = exports.selectOpenApiSpecQuestion = exports.searchOpenAPISpecQueryQuestion = exports.apiSpecTypeSelectQuestion = exports.selectBotIdsQuestion = exports.selectTabsContentUrlQuestion = exports.selectTabWebsiteUrlQuestion = exports.getTabWebsiteOptions = exports.appNameQuestion = exports.getSolutionName = exports.folderQuestion = exports.SPFxImportFolderQuestion = exports.SPFxWebpartNameQuestion = exports.SPFxFrameworkQuestion = exports.SPFxPackageSelectQuestion = exports.SPFxSolutionQuestion = exports.getProjectTypeAndCapability = void 0;
|
|
6
6
|
const tslib_1 = require("tslib");
|
|
7
7
|
const m365_spec_parser_1 = require("@microsoft/m365-spec-parser");
|
|
8
8
|
const teamsfx_api_1 = require("@microsoft/teamsfx-api");
|
|
@@ -12,236 +12,52 @@ const os = tslib_1.__importStar(require("os"));
|
|
|
12
12
|
const path = tslib_1.__importStar(require("path"));
|
|
13
13
|
const constants_1 = require("../common/constants");
|
|
14
14
|
const correlator_1 = require("../common/correlator");
|
|
15
|
-
const
|
|
15
|
+
const daSpecParser_1 = require("../common/daSpecParser");
|
|
16
16
|
const globalVars_1 = require("../common/globalVars");
|
|
17
|
+
const kiotaClient_1 = require("../common/kiotaClient");
|
|
17
18
|
const localizeUtils_1 = require("../common/localizeUtils");
|
|
18
19
|
const samples_1 = require("../common/samples");
|
|
19
20
|
const stringUtils_1 = require("../common/stringUtils");
|
|
20
21
|
const telemetry_1 = require("../common/telemetry");
|
|
21
22
|
const PluginManifestUtils_1 = require("../component/driver/teamsApp/utils/PluginManifestUtils");
|
|
22
23
|
const utils_1 = require("../component/driver/teamsApp/utils/utils");
|
|
24
|
+
const constant_1 = require("../component/generator/constant");
|
|
23
25
|
const helper_1 = require("../component/generator/declarativeAgent/helper");
|
|
24
26
|
const helper_2 = require("../component/generator/openApiSpec/helper");
|
|
25
27
|
const error_1 = require("../component/generator/spfx/error");
|
|
26
28
|
const constants_2 = require("../component/generator/spfx/utils/constants");
|
|
27
29
|
const utils_2 = require("../component/generator/spfx/utils/utils");
|
|
30
|
+
const templateNames_1 = require("../component/generator/templates/templateNames");
|
|
28
31
|
const error_2 = require("../error");
|
|
29
32
|
const constants_3 = require("./constants");
|
|
30
|
-
const
|
|
31
|
-
const
|
|
32
|
-
const kiotaClient_1 = require("../common/kiotaClient");
|
|
33
|
-
const daSpecParser_1 = require("../common/daSpecParser");
|
|
33
|
+
const CapabilityOptions_1 = require("./scaffold/vsc/CapabilityOptions");
|
|
34
|
+
const ProjectTypeOptions_1 = require("./scaffold/vsc/ProjectTypeOptions");
|
|
34
35
|
const utils_3 = require("./utils");
|
|
35
|
-
|
|
36
|
-
const staticOptions = [
|
|
37
|
-
constants_3.ProjectTypeOptions.bot(teamsfx_api_1.Platform.CLI),
|
|
38
|
-
constants_3.ProjectTypeOptions.tab(teamsfx_api_1.Platform.CLI),
|
|
39
|
-
constants_3.ProjectTypeOptions.me(teamsfx_api_1.Platform.CLI),
|
|
40
|
-
constants_3.ProjectTypeOptions.outlookAddin(teamsfx_api_1.Platform.CLI),
|
|
41
|
-
];
|
|
42
|
-
return {
|
|
43
|
-
name: constants_3.QuestionNames.ProjectType,
|
|
44
|
-
title: (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.title"),
|
|
45
|
-
type: "singleSelect",
|
|
46
|
-
staticOptions: staticOptions,
|
|
47
|
-
dynamicOptions: (inputs) => {
|
|
48
|
-
var _a;
|
|
49
|
-
const staticOptions = [];
|
|
50
|
-
staticOptions.push(constants_3.ProjectTypeOptions.Agent(inputs.platform));
|
|
51
|
-
if ((0, constants_3.getRuntime)(inputs) === constants_3.RuntimeOptions.NodeJS().id) {
|
|
52
|
-
staticOptions.push(constants_3.ProjectTypeOptions.customCopilot(inputs.platform));
|
|
53
|
-
}
|
|
54
|
-
staticOptions.push(constants_3.ProjectTypeOptions.bot(inputs.platform), constants_3.ProjectTypeOptions.tab(inputs.platform), constants_3.ProjectTypeOptions.me(inputs.platform));
|
|
55
|
-
if (isFromDevPortal(inputs)) {
|
|
56
|
-
const projectType = (_a = getProjectTypeAndCapability(inputs.teamsAppFromTdp)) === null || _a === void 0 ? void 0 : _a.projectType;
|
|
57
|
-
if (projectType) {
|
|
58
|
-
return [projectType];
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
else if ((0, constants_3.getRuntime)(inputs) === constants_3.RuntimeOptions.NodeJS().id) {
|
|
62
|
-
if (featureFlags_1.featureFlagManager.getBooleanValue(featureFlags_1.FeatureFlags.OfficeMetaOS)) {
|
|
63
|
-
staticOptions.push(constants_3.ProjectTypeOptions.officeMetaOS(inputs.platform));
|
|
64
|
-
}
|
|
65
|
-
else {
|
|
66
|
-
staticOptions.push(constants_3.ProjectTypeOptions.outlookAddin(inputs.platform));
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
if (inputs.platform === teamsfx_api_1.Platform.VSCode &&
|
|
70
|
-
featureFlags_1.featureFlagManager.getBooleanValue(featureFlags_1.FeatureFlags.ChatParticipantUIEntries) &&
|
|
71
|
-
!inputs.teamsAppFromTdp) {
|
|
72
|
-
staticOptions.push(constants_3.ProjectTypeOptions.startWithGithubCopilot());
|
|
73
|
-
}
|
|
74
|
-
return staticOptions;
|
|
75
|
-
},
|
|
76
|
-
placeholder: (0, localizeUtils_1.getLocalizedString)("core.getCreateNewOrFromSampleQuestion.placeholder"),
|
|
77
|
-
forgetLastValue: true,
|
|
78
|
-
skipSingleOption: true,
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
exports.projectTypeQuestion = projectTypeQuestion;
|
|
36
|
+
const ManifestUtils_1 = require("../component/driver/teamsApp/utils/ManifestUtils");
|
|
82
37
|
function getProjectTypeAndCapability(teamsApp) {
|
|
83
38
|
// tab with bot, tab with message extension, tab with bot and message extension
|
|
84
39
|
if ((0, utils_1.needTabAndBotCode)(teamsApp)) {
|
|
85
|
-
return { projectType: "tab-bot-type", templateId:
|
|
40
|
+
return { projectType: "tab-bot-type", templateId: CapabilityOptions_1.TdpCapabilityOptions.nonSsoTabAndBot().id };
|
|
86
41
|
}
|
|
87
42
|
// tab only
|
|
88
43
|
if ((0, utils_1.needTabCode)(teamsApp)) {
|
|
89
|
-
return { projectType: "tab-type", templateId:
|
|
44
|
+
return { projectType: "tab-type", templateId: CapabilityOptions_1.TdpCapabilityOptions.nonSsoTab().id };
|
|
90
45
|
}
|
|
91
46
|
// bot and message extension
|
|
92
47
|
if ((0, utils_1.isBotAndBotBasedMessageExtension)(teamsApp)) {
|
|
93
|
-
return { projectType: "bot-me-type", templateId:
|
|
48
|
+
return { projectType: "bot-me-type", templateId: CapabilityOptions_1.TdpCapabilityOptions.botAndMe().id };
|
|
94
49
|
}
|
|
95
50
|
// bot based message extension
|
|
96
51
|
if ((0, utils_1.isBotBasedMessageExtension)(teamsApp)) {
|
|
97
|
-
return { projectType: "me-type", templateId:
|
|
52
|
+
return { projectType: "me-type", templateId: CapabilityOptions_1.TdpCapabilityOptions.me().id };
|
|
98
53
|
}
|
|
99
54
|
// bot
|
|
100
55
|
if ((0, utils_1.isBot)(teamsApp)) {
|
|
101
|
-
return { projectType: "bot-type", templateId:
|
|
56
|
+
return { projectType: "bot-type", templateId: CapabilityOptions_1.BotCapabilityOptions.basicBot().id };
|
|
102
57
|
}
|
|
103
58
|
return undefined;
|
|
104
59
|
}
|
|
105
60
|
exports.getProjectTypeAndCapability = getProjectTypeAndCapability;
|
|
106
|
-
function isFromDevPortal(inputs) {
|
|
107
|
-
return !!(inputs === null || inputs === void 0 ? void 0 : inputs.teamsAppFromTdp);
|
|
108
|
-
}
|
|
109
|
-
exports.isFromDevPortal = isFromDevPortal;
|
|
110
|
-
function capabilityQuestion() {
|
|
111
|
-
return {
|
|
112
|
-
name: constants_3.QuestionNames.Capabilities,
|
|
113
|
-
title: (inputs) => {
|
|
114
|
-
const projectType = inputs[constants_3.QuestionNames.ProjectType];
|
|
115
|
-
switch (projectType) {
|
|
116
|
-
case constants_3.ProjectTypeOptions.bot().id:
|
|
117
|
-
return (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.projectType.bot.title");
|
|
118
|
-
case constants_3.ProjectTypeOptions.tab().id:
|
|
119
|
-
return (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.projectType.tab.title");
|
|
120
|
-
case constants_3.ProjectTypeOptions.me().id:
|
|
121
|
-
return (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.projectType.messageExtension.title");
|
|
122
|
-
case constants_3.ProjectTypeOptions.outlookAddin().id:
|
|
123
|
-
return (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.projectType.outlookAddin.title");
|
|
124
|
-
case constants_3.ProjectTypeOptions.officeMetaOS().id:
|
|
125
|
-
case constants_3.ProjectTypeOptions.Agent().id:
|
|
126
|
-
return (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.projectType.copilotExtension.title");
|
|
127
|
-
case constants_3.ProjectTypeOptions.customCopilot().id:
|
|
128
|
-
return (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.projectType.customCopilot.title");
|
|
129
|
-
default:
|
|
130
|
-
return (0, localizeUtils_1.getLocalizedString)("core.createCapabilityQuestion.titleNew");
|
|
131
|
-
}
|
|
132
|
-
},
|
|
133
|
-
cliDescription: "Specifies the app feature.",
|
|
134
|
-
cliName: constants_3.CliQuestionName.Capability,
|
|
135
|
-
cliShortName: "c",
|
|
136
|
-
cliChoiceListCommand: "teamsapp list templates",
|
|
137
|
-
type: "singleSelect",
|
|
138
|
-
staticOptions: constants_3.CapabilityOptions.staticAll(),
|
|
139
|
-
dynamicOptions: (inputs) => {
|
|
140
|
-
var _a;
|
|
141
|
-
// from dev portal
|
|
142
|
-
if (isFromDevPortal(inputs)) {
|
|
143
|
-
const capability = (_a = getProjectTypeAndCapability(inputs.teamsAppFromTdp)) === null || _a === void 0 ? void 0 : _a.templateId;
|
|
144
|
-
if (capability) {
|
|
145
|
-
return [capability];
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
// dotnet capabilities
|
|
149
|
-
if (inputs.platform === teamsfx_api_1.Platform.VS) {
|
|
150
|
-
return constants_3.CapabilityOptions.dotnetCaps(inputs);
|
|
151
|
-
}
|
|
152
|
-
if (inputs.nonInteractive && inputs.platform === teamsfx_api_1.Platform.CLI) {
|
|
153
|
-
//cli non-interactive mode the choice list is the same as staticOptions
|
|
154
|
-
return constants_3.CapabilityOptions.all(inputs);
|
|
155
|
-
}
|
|
156
|
-
// capabilities if VSC or CLI interactive mode
|
|
157
|
-
const projectType = inputs[constants_3.QuestionNames.ProjectType];
|
|
158
|
-
if (projectType === constants_3.ProjectTypeOptions.bot().id) {
|
|
159
|
-
return constants_3.CapabilityOptions.bots(inputs);
|
|
160
|
-
}
|
|
161
|
-
else if (projectType === constants_3.ProjectTypeOptions.tab().id) {
|
|
162
|
-
return constants_3.CapabilityOptions.tabs();
|
|
163
|
-
}
|
|
164
|
-
else if (projectType === constants_3.ProjectTypeOptions.me().id) {
|
|
165
|
-
return constants_3.CapabilityOptions.mes();
|
|
166
|
-
}
|
|
167
|
-
else if (constants_3.ProjectTypeOptions.officeAddinAllIds().includes(projectType)) {
|
|
168
|
-
return constants_3.CapabilityOptions.officeAddinCapabilities(projectType);
|
|
169
|
-
}
|
|
170
|
-
else if (projectType === constants_3.ProjectTypeOptions.Agent().id) {
|
|
171
|
-
return constants_3.CapabilityOptions.agents();
|
|
172
|
-
}
|
|
173
|
-
else if (projectType === constants_3.ProjectTypeOptions.customCopilot().id) {
|
|
174
|
-
return constants_3.CapabilityOptions.customCopilots();
|
|
175
|
-
}
|
|
176
|
-
else {
|
|
177
|
-
return constants_3.CapabilityOptions.all(inputs);
|
|
178
|
-
}
|
|
179
|
-
},
|
|
180
|
-
placeholder: (inputs) => {
|
|
181
|
-
if (inputs[constants_3.QuestionNames.ProjectType] === constants_3.ProjectTypeOptions.Agent().id) {
|
|
182
|
-
return (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.projectType.copilotExtension.placeholder");
|
|
183
|
-
}
|
|
184
|
-
else if (inputs[constants_3.QuestionNames.ProjectType] === constants_3.ProjectTypeOptions.customCopilot().id) {
|
|
185
|
-
return (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.projectType.customCopilot.placeholder");
|
|
186
|
-
}
|
|
187
|
-
return (0, localizeUtils_1.getLocalizedString)("core.createCapabilityQuestion.placeholder");
|
|
188
|
-
},
|
|
189
|
-
forgetLastValue: true,
|
|
190
|
-
skipSingleOption: (inputs) => {
|
|
191
|
-
const projectType = inputs[constants_3.QuestionNames.ProjectType];
|
|
192
|
-
if (projectType === constants_3.ProjectTypeOptions.Agent().id) {
|
|
193
|
-
return true;
|
|
194
|
-
}
|
|
195
|
-
return isFromDevPortal(inputs);
|
|
196
|
-
},
|
|
197
|
-
};
|
|
198
|
-
}
|
|
199
|
-
exports.capabilityQuestion = capabilityQuestion;
|
|
200
|
-
function meArchitectureQuestion() {
|
|
201
|
-
return {
|
|
202
|
-
name: constants_3.QuestionNames.MeArchitectureType,
|
|
203
|
-
title: (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.meArchitecture.title"),
|
|
204
|
-
cliDescription: "Architecture of Search Based Message Extension.",
|
|
205
|
-
cliShortName: "m",
|
|
206
|
-
type: "singleSelect",
|
|
207
|
-
staticOptions: constants_3.MeArchitectureOptions.staticAll(),
|
|
208
|
-
dynamicOptions: (inputs) => {
|
|
209
|
-
return constants_3.MeArchitectureOptions.all();
|
|
210
|
-
},
|
|
211
|
-
default: constants_3.MeArchitectureOptions.newApi().id,
|
|
212
|
-
placeholder: (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.projectType.copilotExtension.placeholder"),
|
|
213
|
-
forgetLastValue: true,
|
|
214
|
-
skipSingleOption: true,
|
|
215
|
-
};
|
|
216
|
-
}
|
|
217
|
-
exports.meArchitectureQuestion = meArchitectureQuestion;
|
|
218
|
-
function botTriggerQuestion() {
|
|
219
|
-
return {
|
|
220
|
-
name: constants_3.QuestionNames.BotTrigger,
|
|
221
|
-
title: (0, localizeUtils_1.getLocalizedString)("plugins.bot.questionHostTypeTrigger.title"),
|
|
222
|
-
cliDescription: "Specifies the trigger for `Chat Notification Message` app template.",
|
|
223
|
-
cliShortName: "t",
|
|
224
|
-
type: "singleSelect",
|
|
225
|
-
staticOptions: constants_3.NotificationTriggerOptions.all(),
|
|
226
|
-
dynamicOptions: (inputs) => {
|
|
227
|
-
const runtime = (0, constants_3.getRuntime)(inputs);
|
|
228
|
-
return [
|
|
229
|
-
runtime === constants_3.RuntimeOptions.DotNet().id
|
|
230
|
-
? constants_3.NotificationTriggerOptions.appServiceForVS()
|
|
231
|
-
: constants_3.NotificationTriggerOptions.appService(),
|
|
232
|
-
...constants_3.NotificationTriggerOptions.functionsTriggers(),
|
|
233
|
-
];
|
|
234
|
-
},
|
|
235
|
-
default: (inputs) => {
|
|
236
|
-
const runtime = (0, constants_3.getRuntime)(inputs);
|
|
237
|
-
return runtime === constants_3.RuntimeOptions.DotNet().id
|
|
238
|
-
? constants_3.NotificationTriggerOptions.appServiceForVS().id
|
|
239
|
-
: constants_3.NotificationTriggerOptions.appService().id;
|
|
240
|
-
},
|
|
241
|
-
placeholder: (0, localizeUtils_1.getLocalizedString)("plugins.bot.questionHostTypeTrigger.placeholder"),
|
|
242
|
-
};
|
|
243
|
-
}
|
|
244
|
-
exports.botTriggerQuestion = botTriggerQuestion;
|
|
245
61
|
function SPFxSolutionQuestion() {
|
|
246
62
|
return {
|
|
247
63
|
type: "singleSelect",
|
|
@@ -382,71 +198,6 @@ function SPFxImportFolderQuestion(hasDefaultFunc = false) {
|
|
|
382
198
|
};
|
|
383
199
|
}
|
|
384
200
|
exports.SPFxImportFolderQuestion = SPFxImportFolderQuestion;
|
|
385
|
-
function getLanguageOptions(inputs) {
|
|
386
|
-
const runtime = (0, constants_3.getRuntime)(inputs);
|
|
387
|
-
// dotnet runtime only supports C#
|
|
388
|
-
if (runtime === constants_3.RuntimeOptions.DotNet().id) {
|
|
389
|
-
return [{ id: constants_3.ProgrammingLanguage.CSharp, label: "C#" }];
|
|
390
|
-
}
|
|
391
|
-
const capabilities = inputs[constants_3.QuestionNames.Capabilities];
|
|
392
|
-
if (capabilities === constants_3.CapabilityOptions.SPFxTab().id) {
|
|
393
|
-
// SPFx only supports typescript
|
|
394
|
-
return [{ id: constants_3.ProgrammingLanguage.TS, label: "TypeScript" }];
|
|
395
|
-
}
|
|
396
|
-
else if (constants_3.capabilitiesHavePythonOption.includes(inputs[capabilities] ? inputs[capabilities] : capabilities) &&
|
|
397
|
-
!(capabilities == constants_3.CapabilityOptions.customCopilotRag().id &&
|
|
398
|
-
inputs[constants_3.CapabilityOptions.customCopilotRag().id] == constants_3.CustomCopilotRagOptions.microsoft365().id)) {
|
|
399
|
-
// support python language
|
|
400
|
-
return [
|
|
401
|
-
{ id: constants_3.ProgrammingLanguage.JS, label: "JavaScript" },
|
|
402
|
-
{ id: constants_3.ProgrammingLanguage.TS, label: "TypeScript" },
|
|
403
|
-
{ id: constants_3.ProgrammingLanguage.PY, label: "Python" },
|
|
404
|
-
];
|
|
405
|
-
}
|
|
406
|
-
else {
|
|
407
|
-
// other cases
|
|
408
|
-
return [
|
|
409
|
-
{ id: constants_3.ProgrammingLanguage.JS, label: "JavaScript" },
|
|
410
|
-
{ id: constants_3.ProgrammingLanguage.TS, label: "TypeScript" },
|
|
411
|
-
];
|
|
412
|
-
}
|
|
413
|
-
}
|
|
414
|
-
exports.getLanguageOptions = getLanguageOptions;
|
|
415
|
-
function programmingLanguageQuestion() {
|
|
416
|
-
const programmingLanguageQuestion = {
|
|
417
|
-
name: constants_3.QuestionNames.ProgrammingLanguage,
|
|
418
|
-
cliShortName: "l",
|
|
419
|
-
title: (0, localizeUtils_1.getLocalizedString)("core.ProgrammingLanguageQuestion.title"),
|
|
420
|
-
type: "singleSelect",
|
|
421
|
-
staticOptions: [
|
|
422
|
-
{ id: constants_3.ProgrammingLanguage.JS, label: "JavaScript" },
|
|
423
|
-
{ id: constants_3.ProgrammingLanguage.TS, label: "TypeScript" },
|
|
424
|
-
{ id: constants_3.ProgrammingLanguage.CSharp, label: "C#" },
|
|
425
|
-
{ id: constants_3.ProgrammingLanguage.PY, label: "Python" },
|
|
426
|
-
],
|
|
427
|
-
dynamicOptions: getLanguageOptions,
|
|
428
|
-
default: (inputs) => {
|
|
429
|
-
return getLanguageOptions(inputs)[0].id;
|
|
430
|
-
},
|
|
431
|
-
placeholder: (inputs) => {
|
|
432
|
-
const runtime = (0, constants_3.getRuntime)(inputs);
|
|
433
|
-
// dotnet
|
|
434
|
-
if (runtime === constants_3.RuntimeOptions.DotNet().id) {
|
|
435
|
-
return "";
|
|
436
|
-
}
|
|
437
|
-
const capabilities = inputs[constants_3.QuestionNames.Capabilities];
|
|
438
|
-
// SPFx
|
|
439
|
-
if (capabilities === constants_3.CapabilityOptions.SPFxTab().id) {
|
|
440
|
-
return (0, localizeUtils_1.getLocalizedString)("core.ProgrammingLanguageQuestion.placeholder.spfx");
|
|
441
|
-
}
|
|
442
|
-
// other
|
|
443
|
-
return (0, localizeUtils_1.getLocalizedString)("core.ProgrammingLanguageQuestion.placeholder");
|
|
444
|
-
},
|
|
445
|
-
skipSingleOption: true,
|
|
446
|
-
};
|
|
447
|
-
return programmingLanguageQuestion;
|
|
448
|
-
}
|
|
449
|
-
exports.programmingLanguageQuestion = programmingLanguageQuestion;
|
|
450
201
|
function folderQuestion() {
|
|
451
202
|
return {
|
|
452
203
|
type: "folder",
|
|
@@ -599,17 +350,6 @@ function sampleSelectQuestion() {
|
|
|
599
350
|
],
|
|
600
351
|
};
|
|
601
352
|
}
|
|
602
|
-
function runtimeQuestion() {
|
|
603
|
-
return {
|
|
604
|
-
type: "singleSelect",
|
|
605
|
-
name: constants_3.QuestionNames.Runtime,
|
|
606
|
-
title: (0, localizeUtils_1.getLocalizedString)("core.getRuntimeQuestion.title"),
|
|
607
|
-
staticOptions: [constants_3.RuntimeOptions.NodeJS(), constants_3.RuntimeOptions.DotNet()],
|
|
608
|
-
default: constants_3.RuntimeOptions.NodeJS().id,
|
|
609
|
-
placeholder: (0, localizeUtils_1.getLocalizedString)("core.getRuntimeQuestion.placeholder"),
|
|
610
|
-
cliHidden: true,
|
|
611
|
-
};
|
|
612
|
-
}
|
|
613
353
|
const defaultTabLocalHostUrl = "https://localhost:53000/index.html#/tab";
|
|
614
354
|
const tabContentUrlOptionItem = (tab) => {
|
|
615
355
|
return {
|
|
@@ -635,6 +375,7 @@ function getTabWebsiteOptions(inputs) {
|
|
|
635
375
|
}
|
|
636
376
|
return [];
|
|
637
377
|
}
|
|
378
|
+
exports.getTabWebsiteOptions = getTabWebsiteOptions;
|
|
638
379
|
function selectTabWebsiteUrlQuestion() {
|
|
639
380
|
return {
|
|
640
381
|
type: "multiSelect",
|
|
@@ -935,7 +676,7 @@ function apiOperationQuestion(includeExistingAPIs = true, isAddPlugin = false) {
|
|
|
935
676
|
if (input.length < 1 ||
|
|
936
677
|
(input.length > 10 &&
|
|
937
678
|
inputs[constants_3.QuestionNames.CustomCopilotRag] !== constants_3.CustomCopilotRagOptions.customApi().id &&
|
|
938
|
-
inputs[constants_3.QuestionNames.ProjectType] !==
|
|
679
|
+
inputs[constants_3.QuestionNames.ProjectType] !== ProjectTypeOptions_1.ProjectTypeOptions.copilotAgentOptionId)) {
|
|
939
680
|
return (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.apiSpec.operation.invalidMessage", input.length, 10);
|
|
940
681
|
}
|
|
941
682
|
const operations = inputs.supportedApisFromApiSpec;
|
|
@@ -1085,29 +826,18 @@ function azureOpenAIDeploymentNameQuestion() {
|
|
|
1085
826
|
};
|
|
1086
827
|
}
|
|
1087
828
|
exports.azureOpenAIDeploymentNameQuestion = azureOpenAIDeploymentNameQuestion;
|
|
1088
|
-
function declarativeCopilotPluginQuestion() {
|
|
1089
|
-
return {
|
|
1090
|
-
type: "singleSelect",
|
|
1091
|
-
name: constants_3.QuestionNames.WithPlugin,
|
|
1092
|
-
title: (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.declarativeCopilot.title"),
|
|
1093
|
-
placeholder: (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.declarativeCopilot.placeholder"),
|
|
1094
|
-
cliDescription: "Whether to add API plugin for your declarative Copilot.",
|
|
1095
|
-
staticOptions: constants_3.DeclarativeCopilotTypeOptions.all(),
|
|
1096
|
-
default: constants_3.DeclarativeCopilotTypeOptions.noPlugin().id,
|
|
1097
|
-
};
|
|
1098
|
-
}
|
|
1099
829
|
function apiPluginStartQuestion(doesProjectExists) {
|
|
1100
830
|
return {
|
|
1101
831
|
type: "singleSelect",
|
|
1102
832
|
name: constants_3.QuestionNames.ActionType,
|
|
1103
833
|
title: (inputs) => {
|
|
1104
|
-
return inputs[constants_3.QuestionNames.Capabilities] ===
|
|
834
|
+
return inputs[constants_3.QuestionNames.Capabilities] === CapabilityOptions_1.DACapabilityOptions.declarativeAgent().id ||
|
|
1105
835
|
doesProjectExists
|
|
1106
836
|
? (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.addApiPlugin.title")
|
|
1107
837
|
: (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.createApiPlugin.title");
|
|
1108
838
|
},
|
|
1109
839
|
placeholder: (inputs) => {
|
|
1110
|
-
return inputs[constants_3.QuestionNames.Capabilities] ===
|
|
840
|
+
return inputs[constants_3.QuestionNames.Capabilities] === CapabilityOptions_1.DACapabilityOptions.declarativeAgent().id ||
|
|
1111
841
|
doesProjectExists
|
|
1112
842
|
? (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.addApiPlugin.placeholder")
|
|
1113
843
|
: (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.projectType.copilotExtension.placeholder");
|
|
@@ -1121,6 +851,146 @@ function apiPluginStartQuestion(doesProjectExists) {
|
|
|
1121
851
|
};
|
|
1122
852
|
}
|
|
1123
853
|
exports.apiPluginStartQuestion = apiPluginStartQuestion;
|
|
854
|
+
function selectExistingPluginManifestQuestion() {
|
|
855
|
+
return {
|
|
856
|
+
type: "singleSelect",
|
|
857
|
+
name: constants_3.QuestionNames.SelectPluginManifest,
|
|
858
|
+
title: (0, localizeUtils_1.getLocalizedString)("core.regenerateQuestion.selectPluginManifestTitle"),
|
|
859
|
+
cliDescription: "Select plugin manifest file.",
|
|
860
|
+
staticOptions: [],
|
|
861
|
+
onDidSelection: (item, inputs) => {
|
|
862
|
+
inputs[constants_3.QuestionNames.SelectPluginId] = item.data;
|
|
863
|
+
},
|
|
864
|
+
dynamicOptions: async (inputs) => {
|
|
865
|
+
var _a, _b, _c;
|
|
866
|
+
if (!inputs.projectPath) {
|
|
867
|
+
throw new Error("projectPath is undefined");
|
|
868
|
+
}
|
|
869
|
+
const options = [];
|
|
870
|
+
const manifestPath = path.join(inputs.projectPath, teamsfx_api_1.AppPackageFolderName, teamsfx_api_1.ManifestTemplateFileName);
|
|
871
|
+
inputs[constants_3.QuestionNames.ManifestPath] = manifestPath;
|
|
872
|
+
const manifestRes = await ManifestUtils_1.manifestUtils._readAppManifest(manifestPath);
|
|
873
|
+
if (manifestRes.isErr()) {
|
|
874
|
+
throw manifestRes.error;
|
|
875
|
+
}
|
|
876
|
+
const manifest = manifestRes.value;
|
|
877
|
+
const declarativeAgentPathRelativePath = (_c = (_b = (_a = manifest === null || manifest === void 0 ? void 0 : manifest.copilotAgents) === null || _a === void 0 ? void 0 : _a.declarativeAgents) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.file;
|
|
878
|
+
if (!declarativeAgentPathRelativePath) {
|
|
879
|
+
throw new error_2.DeclarativeAgentPathNotFoundError(manifestPath);
|
|
880
|
+
}
|
|
881
|
+
const declarativeAgentPath = path.join(inputs.projectPath, teamsfx_api_1.AppPackageFolderName, declarativeAgentPathRelativePath);
|
|
882
|
+
const declarativeAgentJson = (await fs_extra_1.default.readJSON(declarativeAgentPath));
|
|
883
|
+
const actions = declarativeAgentJson.actions;
|
|
884
|
+
if (!actions || actions.length === 0) {
|
|
885
|
+
throw new error_2.ActionNotFoundError(declarativeAgentPath);
|
|
886
|
+
}
|
|
887
|
+
for (const action of actions) {
|
|
888
|
+
const actionName = action.file;
|
|
889
|
+
options.push({
|
|
890
|
+
id: path.join(inputs.projectPath, teamsfx_api_1.AppPackageFolderName, actionName),
|
|
891
|
+
label: path.basename(actionName),
|
|
892
|
+
data: action.id,
|
|
893
|
+
});
|
|
894
|
+
}
|
|
895
|
+
return options;
|
|
896
|
+
},
|
|
897
|
+
};
|
|
898
|
+
}
|
|
899
|
+
exports.selectExistingPluginManifestQuestion = selectExistingPluginManifestQuestion;
|
|
900
|
+
function selectOpenAPISpecFromPluginQuestion() {
|
|
901
|
+
return {
|
|
902
|
+
type: "singleSelect",
|
|
903
|
+
name: constants_3.QuestionNames.SelectOpenAPISpecFromPlugin,
|
|
904
|
+
title: (0, localizeUtils_1.getLocalizedString)("core.regenerateQuestion.selectOpenAPISpecFromPluginTitle"),
|
|
905
|
+
cliDescription: "Select OpenAPI description document file.",
|
|
906
|
+
staticOptions: [],
|
|
907
|
+
onDidSelection: (itemOrId, inputs) => {
|
|
908
|
+
inputs[constants_3.QuestionNames.ActionType] = constants_3.DeclarativeAgentApiSpecOptionId;
|
|
909
|
+
},
|
|
910
|
+
dynamicOptions: async (inputs) => {
|
|
911
|
+
var _a;
|
|
912
|
+
const pluginPath = inputs[constants_3.QuestionNames.SelectPluginManifest];
|
|
913
|
+
const options = [];
|
|
914
|
+
const pluginManifest = await fs_extra_1.default.readJSON(inputs[constants_3.QuestionNames.SelectPluginManifest]);
|
|
915
|
+
const specUrlMap = new Map();
|
|
916
|
+
(_a = pluginManifest.runtimes) === null || _a === void 0 ? void 0 : _a.forEach((runtime) => {
|
|
917
|
+
if (runtime.spec) {
|
|
918
|
+
const specPath = runtime.spec.url;
|
|
919
|
+
const functions = runtime.run_for_functions;
|
|
920
|
+
if (specUrlMap.has(specPath)) {
|
|
921
|
+
const existingValue = specUrlMap.get(specPath);
|
|
922
|
+
if (existingValue) {
|
|
923
|
+
existingValue.push(...(functions !== null && functions !== void 0 ? functions : []));
|
|
924
|
+
}
|
|
925
|
+
}
|
|
926
|
+
else {
|
|
927
|
+
specUrlMap.set(specPath, functions !== null && functions !== void 0 ? functions : []);
|
|
928
|
+
}
|
|
929
|
+
}
|
|
930
|
+
});
|
|
931
|
+
specUrlMap.forEach((value, key) => {
|
|
932
|
+
const specAbsolutePath = path.join(path.dirname(pluginPath), key);
|
|
933
|
+
options.push({
|
|
934
|
+
id: specAbsolutePath,
|
|
935
|
+
label: key,
|
|
936
|
+
});
|
|
937
|
+
});
|
|
938
|
+
if (options.length === 0) {
|
|
939
|
+
throw new error_2.SpecNotFoundError(pluginPath);
|
|
940
|
+
}
|
|
941
|
+
return options;
|
|
942
|
+
},
|
|
943
|
+
};
|
|
944
|
+
}
|
|
945
|
+
exports.selectOpenAPISpecFromPluginQuestion = selectOpenAPISpecFromPluginQuestion;
|
|
946
|
+
function selectApiOperationForRegenerateQuestion() {
|
|
947
|
+
return {
|
|
948
|
+
type: "multiSelect",
|
|
949
|
+
name: constants_3.QuestionNames.ApiOperation,
|
|
950
|
+
title: (0, localizeUtils_1.getLocalizedString)("core.regenerateQuestion.selectApiOperationForRegenerateTitle"),
|
|
951
|
+
cliDescription: "Select operation(s) Copilot can interact with.",
|
|
952
|
+
cliShortName: "o",
|
|
953
|
+
placeholder: (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.apiSpec.operation.plugin.placeholder"),
|
|
954
|
+
forgetLastValue: true,
|
|
955
|
+
staticOptions: [],
|
|
956
|
+
validation: {
|
|
957
|
+
validFunc: (input, inputs) => {
|
|
958
|
+
const operations = inputs.supportedApisFromApiSpec;
|
|
959
|
+
const serverUrls = new Set();
|
|
960
|
+
for (const inputItem of input) {
|
|
961
|
+
const operation = operations.find((op) => op.id === inputItem);
|
|
962
|
+
if (operation) {
|
|
963
|
+
serverUrls.add(operation.data.serverUrl);
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
if (serverUrls.size > 1) {
|
|
967
|
+
return (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.apiSpec.operation.multipleServer", Array.from(serverUrls).join(", "));
|
|
968
|
+
}
|
|
969
|
+
},
|
|
970
|
+
},
|
|
971
|
+
dynamicOptions: async (inputs) => {
|
|
972
|
+
const specUrl = inputs[constants_3.QuestionNames.SelectOpenAPISpecFromPlugin] + ".original";
|
|
973
|
+
if (!(await fs_extra_1.default.pathExists(specUrl))) {
|
|
974
|
+
throw new error_2.OriginalSpecNotFoundError(specUrl);
|
|
975
|
+
}
|
|
976
|
+
inputs[constants_3.QuestionNames.ApiSpecLocation] = specUrl;
|
|
977
|
+
const context = (0, globalVars_1.createContext)();
|
|
978
|
+
const res = await (0, helper_2.listOperations)(context, specUrl, inputs, true, false);
|
|
979
|
+
if (res.isOk()) {
|
|
980
|
+
inputs.supportedApisFromApiSpec = res.value;
|
|
981
|
+
}
|
|
982
|
+
else {
|
|
983
|
+
throw res.error;
|
|
984
|
+
}
|
|
985
|
+
if (!inputs.supportedApisFromApiSpec || inputs.supportedApisFromApiSpec.length === 0) {
|
|
986
|
+
throw new error_2.EmptyOptionError(constants_3.QuestionNames.ApiOperation, "question");
|
|
987
|
+
}
|
|
988
|
+
const operations = inputs.supportedApisFromApiSpec;
|
|
989
|
+
return operations;
|
|
990
|
+
},
|
|
991
|
+
};
|
|
992
|
+
}
|
|
993
|
+
exports.selectApiOperationForRegenerateQuestion = selectApiOperationForRegenerateQuestion;
|
|
1124
994
|
function pluginManifestQuestion() {
|
|
1125
995
|
const correlationId = correlator_1.Correlator.getId();
|
|
1126
996
|
return {
|
|
@@ -1395,7 +1265,7 @@ function GCNameQuestion() {
|
|
|
1395
1265
|
inputs = (0, utils_3.ensureInputs)(inputs);
|
|
1396
1266
|
inputs[constants_3.QuestionNames.ProgrammingLanguage] = constants_3.ProgrammingLanguage.TS;
|
|
1397
1267
|
// Set template name and app name for Graph Connector Template
|
|
1398
|
-
if (inputs[constants_3.QuestionNames.ProjectType] !==
|
|
1268
|
+
if (inputs[constants_3.QuestionNames.ProjectType] !== ProjectTypeOptions_1.ProjectTypeOptions.copilotAgentOptionId) {
|
|
1399
1269
|
inputs[constants_3.QuestionNames.TemplateName] = templateNames_1.TemplateNames.GraphConnector;
|
|
1400
1270
|
inputs[constants_3.QuestionNames.AppName] = input;
|
|
1401
1271
|
}
|
|
@@ -1408,7 +1278,7 @@ function GCNameQuestion() {
|
|
|
1408
1278
|
return "Please enter a graph connector name.";
|
|
1409
1279
|
}
|
|
1410
1280
|
inputs = (0, utils_3.ensureInputs)(inputs);
|
|
1411
|
-
if (inputs[constants_3.QuestionNames.ProjectType] !==
|
|
1281
|
+
if (inputs[constants_3.QuestionNames.ProjectType] !== ProjectTypeOptions_1.ProjectTypeOptions.copilotAgentOptionId) {
|
|
1412
1282
|
// Graph Connector Template will use the name as app name, which has a minimum length of 2.
|
|
1413
1283
|
if (input.trim().length < 2) {
|
|
1414
1284
|
return "Please enter a graph connector name with minimum two characters.";
|
|
@@ -1474,272 +1344,6 @@ function GCConnectionIdQuestion() {
|
|
|
1474
1344
|
};
|
|
1475
1345
|
}
|
|
1476
1346
|
exports.GCConnectionIdQuestion = GCConnectionIdQuestion;
|
|
1477
|
-
function capabilitySubTree() {
|
|
1478
|
-
const node = {
|
|
1479
|
-
data: capabilityQuestion(),
|
|
1480
|
-
children: [
|
|
1481
|
-
{
|
|
1482
|
-
// Notification bot trigger sub-tree
|
|
1483
|
-
condition: { equals: constants_3.CapabilityOptions.notificationBot().id },
|
|
1484
|
-
data: botTriggerQuestion(),
|
|
1485
|
-
},
|
|
1486
|
-
{
|
|
1487
|
-
// SPFx sub-tree
|
|
1488
|
-
condition: { equals: constants_3.CapabilityOptions.SPFxTab().id },
|
|
1489
|
-
data: SPFxSolutionQuestion(),
|
|
1490
|
-
children: [
|
|
1491
|
-
{
|
|
1492
|
-
data: { type: "group" },
|
|
1493
|
-
children: [
|
|
1494
|
-
{ data: SPFxPackageSelectQuestion() },
|
|
1495
|
-
{ data: SPFxFrameworkQuestion() },
|
|
1496
|
-
{ data: SPFxWebpartNameQuestion() },
|
|
1497
|
-
],
|
|
1498
|
-
condition: { equals: "new" },
|
|
1499
|
-
},
|
|
1500
|
-
{
|
|
1501
|
-
data: SPFxImportFolderQuestion(),
|
|
1502
|
-
condition: { equals: "import" },
|
|
1503
|
-
},
|
|
1504
|
-
],
|
|
1505
|
-
},
|
|
1506
|
-
{
|
|
1507
|
-
// office addin import sub-tree (capabilities=office-addin-import | outlook-addin-import)
|
|
1508
|
-
condition: {
|
|
1509
|
-
enum: [
|
|
1510
|
-
constants_3.CapabilityOptions.outlookAddinImport().id,
|
|
1511
|
-
constants_3.CapabilityOptions.officeAddinImport().id,
|
|
1512
|
-
],
|
|
1513
|
-
},
|
|
1514
|
-
data: { type: "group", name: constants_3.QuestionNames.OfficeAddinImport },
|
|
1515
|
-
children: [
|
|
1516
|
-
{
|
|
1517
|
-
data: {
|
|
1518
|
-
type: "folder",
|
|
1519
|
-
name: constants_3.QuestionNames.OfficeAddinFolder,
|
|
1520
|
-
title: "Existing add-in project folder",
|
|
1521
|
-
},
|
|
1522
|
-
},
|
|
1523
|
-
{
|
|
1524
|
-
data: {
|
|
1525
|
-
type: "singleFile",
|
|
1526
|
-
name: constants_3.QuestionNames.OfficeAddinManifest,
|
|
1527
|
-
title: "Select import project manifest file",
|
|
1528
|
-
},
|
|
1529
|
-
},
|
|
1530
|
-
],
|
|
1531
|
-
},
|
|
1532
|
-
{
|
|
1533
|
-
// Search ME sub-tree
|
|
1534
|
-
condition: { equals: constants_3.CapabilityOptions.m365SearchMe().id },
|
|
1535
|
-
data: meArchitectureQuestion(),
|
|
1536
|
-
},
|
|
1537
|
-
{
|
|
1538
|
-
condition: { equals: constants_3.CapabilityOptions.declarativeAgent().id },
|
|
1539
|
-
data: declarativeCopilotPluginQuestion(),
|
|
1540
|
-
},
|
|
1541
|
-
{
|
|
1542
|
-
condition: (inputs) => {
|
|
1543
|
-
return (inputs[constants_3.QuestionNames.Capabilities] === constants_3.CapabilityOptions.apiPlugin().id ||
|
|
1544
|
-
inputs[constants_3.QuestionNames.WithPlugin] === constants_3.DeclarativeCopilotTypeOptions.withPlugin().id);
|
|
1545
|
-
},
|
|
1546
|
-
data: apiPluginStartQuestion(),
|
|
1547
|
-
},
|
|
1548
|
-
{
|
|
1549
|
-
condition: (inputs) => {
|
|
1550
|
-
return inputs[constants_3.QuestionNames.ActionType] === constants_3.ActionStartOptions.existingPlugin().id;
|
|
1551
|
-
},
|
|
1552
|
-
data: { type: "group", name: constants_3.QuestionNames.ImportPlugin },
|
|
1553
|
-
children: [
|
|
1554
|
-
{
|
|
1555
|
-
data: pluginManifestQuestion(),
|
|
1556
|
-
},
|
|
1557
|
-
{
|
|
1558
|
-
data: pluginApiSpecQuestion(),
|
|
1559
|
-
},
|
|
1560
|
-
],
|
|
1561
|
-
},
|
|
1562
|
-
{
|
|
1563
|
-
condition: (inputs) => {
|
|
1564
|
-
return (inputs[constants_3.QuestionNames.MeArchitectureType] == constants_3.MeArchitectureOptions.newApi().id ||
|
|
1565
|
-
inputs[constants_3.QuestionNames.ActionType] == constants_3.ActionStartOptions.newApi().id);
|
|
1566
|
-
},
|
|
1567
|
-
data: apiAuthQuestion(),
|
|
1568
|
-
},
|
|
1569
|
-
{
|
|
1570
|
-
condition: (inputs) => {
|
|
1571
|
-
return inputs[constants_3.QuestionNames.Capabilities] == constants_3.CapabilityOptions.customCopilotRag().id;
|
|
1572
|
-
},
|
|
1573
|
-
data: customCopilotRagQuestion(),
|
|
1574
|
-
},
|
|
1575
|
-
{
|
|
1576
|
-
// from API spec
|
|
1577
|
-
condition: (inputs) => {
|
|
1578
|
-
return ((inputs[constants_3.QuestionNames.ActionType] === constants_3.ActionStartOptions.apiSpec().id ||
|
|
1579
|
-
inputs[constants_3.QuestionNames.MeArchitectureType] === constants_3.MeArchitectureOptions.apiSpec().id ||
|
|
1580
|
-
inputs[constants_3.QuestionNames.CustomCopilotRag] === constants_3.CustomCopilotRagOptions.customApi().id) &&
|
|
1581
|
-
!(
|
|
1582
|
-
// Only skip this project when need to rediect to Kiota: 1. Feature flag enabled 2. Creating plugin/declarative copilot from existing spec
|
|
1583
|
-
(featureFlags_1.featureFlagManager.getBooleanValue(featureFlags_1.FeatureFlags.KiotaIntegration) &&
|
|
1584
|
-
inputs[constants_3.QuestionNames.ActionType] === constants_3.ActionStartOptions.apiSpec().id &&
|
|
1585
|
-
(inputs[constants_3.QuestionNames.Capabilities] === constants_3.CapabilityOptions.apiPlugin().id ||
|
|
1586
|
-
inputs[constants_3.QuestionNames.Capabilities] === constants_3.CapabilityOptions.declarativeAgent().id))));
|
|
1587
|
-
},
|
|
1588
|
-
data: { type: "group", name: constants_3.QuestionNames.FromExistingApi },
|
|
1589
|
-
children: [
|
|
1590
|
-
{
|
|
1591
|
-
data: apiSpecLocationQuestion(),
|
|
1592
|
-
},
|
|
1593
|
-
{
|
|
1594
|
-
data: apiOperationQuestion(),
|
|
1595
|
-
condition: (inputs) => {
|
|
1596
|
-
return !inputs[constants_3.QuestionNames.ActionManifestPath];
|
|
1597
|
-
},
|
|
1598
|
-
},
|
|
1599
|
-
],
|
|
1600
|
-
},
|
|
1601
|
-
{
|
|
1602
|
-
condition: (inputs) => {
|
|
1603
|
-
return (inputs[constants_3.QuestionNames.Capabilities] == constants_3.CapabilityOptions.customCopilotAssistant().id);
|
|
1604
|
-
},
|
|
1605
|
-
data: customCopilotAssistantQuestion(),
|
|
1606
|
-
},
|
|
1607
|
-
{
|
|
1608
|
-
// programming language
|
|
1609
|
-
data: programmingLanguageQuestion(),
|
|
1610
|
-
condition: (inputs) => {
|
|
1611
|
-
return ((!!inputs[constants_3.QuestionNames.Capabilities] &&
|
|
1612
|
-
inputs[constants_3.QuestionNames.WithPlugin] !== constants_3.DeclarativeCopilotTypeOptions.noPlugin().id &&
|
|
1613
|
-
inputs[constants_3.QuestionNames.ActionType] !== constants_3.ActionStartOptions.apiSpec().id &&
|
|
1614
|
-
inputs[constants_3.QuestionNames.ActionType] !== constants_3.ActionStartOptions.existingPlugin().id &&
|
|
1615
|
-
inputs[constants_3.QuestionNames.MeArchitectureType] !== constants_3.MeArchitectureOptions.apiSpec().id &&
|
|
1616
|
-
inputs[constants_3.QuestionNames.ProjectType] !== constants_3.ProjectTypeOptions.officeMetaOS().id &&
|
|
1617
|
-
inputs[constants_3.QuestionNames.ProjectType] !== constants_3.ProjectTypeOptions.outlookAddin().id) ||
|
|
1618
|
-
(0, constants_3.getRuntime)(inputs) === constants_3.RuntimeOptions.DotNet().id);
|
|
1619
|
-
},
|
|
1620
|
-
},
|
|
1621
|
-
{
|
|
1622
|
-
condition: (inputs) => {
|
|
1623
|
-
return (inputs[constants_3.QuestionNames.Capabilities] === constants_3.CapabilityOptions.customCopilotBasic().id ||
|
|
1624
|
-
inputs[constants_3.QuestionNames.Capabilities] === constants_3.CapabilityOptions.customCopilotRag().id ||
|
|
1625
|
-
inputs[constants_3.QuestionNames.Capabilities] === constants_3.CapabilityOptions.customCopilotAssistant().id ||
|
|
1626
|
-
inputs[constants_3.QuestionNames.Capabilities] === constants_3.CapabilityOptions.customCopilotWeather().id);
|
|
1627
|
-
},
|
|
1628
|
-
data: llmServiceQuestion(),
|
|
1629
|
-
children: [
|
|
1630
|
-
{
|
|
1631
|
-
condition: { equals: "llm-service-azure-openai" },
|
|
1632
|
-
data: azureOpenAIKeyQuestion(),
|
|
1633
|
-
children: [
|
|
1634
|
-
{
|
|
1635
|
-
condition: (inputs) => {
|
|
1636
|
-
var _a;
|
|
1637
|
-
return ((_a = inputs[constants_3.QuestionNames.AzureOpenAIKey]) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
|
1638
|
-
},
|
|
1639
|
-
data: azureOpenAIEndpointQuestion(),
|
|
1640
|
-
children: [
|
|
1641
|
-
{
|
|
1642
|
-
condition: (inputs) => {
|
|
1643
|
-
var _a;
|
|
1644
|
-
return ((_a = inputs[constants_3.QuestionNames.AzureOpenAIEndpoint]) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
|
1645
|
-
},
|
|
1646
|
-
data: azureOpenAIDeploymentNameQuestion(),
|
|
1647
|
-
},
|
|
1648
|
-
],
|
|
1649
|
-
},
|
|
1650
|
-
],
|
|
1651
|
-
},
|
|
1652
|
-
{
|
|
1653
|
-
condition: { equals: "llm-service-openai" },
|
|
1654
|
-
data: openAIKeyQuestion(),
|
|
1655
|
-
},
|
|
1656
|
-
],
|
|
1657
|
-
},
|
|
1658
|
-
{
|
|
1659
|
-
// root folder
|
|
1660
|
-
data: folderQuestion(),
|
|
1661
|
-
condition: (inputs) => {
|
|
1662
|
-
// Only skip this project when need to rediect to Kiota: 1. Feature flag enabled 2. Creating plugin/declarative copilot from existing spec 3. No plugin manifest path
|
|
1663
|
-
return !(featureFlags_1.featureFlagManager.getBooleanValue(featureFlags_1.FeatureFlags.KiotaIntegration) &&
|
|
1664
|
-
inputs[constants_3.QuestionNames.ActionType] === constants_3.ActionStartOptions.apiSpec().id &&
|
|
1665
|
-
(inputs[constants_3.QuestionNames.Capabilities] === constants_3.CapabilityOptions.apiPlugin().id ||
|
|
1666
|
-
inputs[constants_3.QuestionNames.Capabilities] === constants_3.CapabilityOptions.declarativeAgent().id) &&
|
|
1667
|
-
!inputs[constants_3.QuestionNames.ActionManifestPath]);
|
|
1668
|
-
},
|
|
1669
|
-
},
|
|
1670
|
-
{
|
|
1671
|
-
// app name
|
|
1672
|
-
data: appNameQuestion(),
|
|
1673
|
-
condition: (inputs) => {
|
|
1674
|
-
// Only skip this project when need to rediect to Kiota: 1. Feature flag enabled 2. Creating plugin/declarative copilot from existing spec 3. No plugin manifest path
|
|
1675
|
-
return !(featureFlags_1.featureFlagManager.getBooleanValue(featureFlags_1.FeatureFlags.KiotaIntegration) &&
|
|
1676
|
-
inputs[constants_3.QuestionNames.ActionType] === constants_3.ActionStartOptions.apiSpec().id &&
|
|
1677
|
-
(inputs[constants_3.QuestionNames.Capabilities] === constants_3.CapabilityOptions.apiPlugin().id ||
|
|
1678
|
-
inputs[constants_3.QuestionNames.Capabilities] === constants_3.CapabilityOptions.declarativeAgent().id) &&
|
|
1679
|
-
!inputs[constants_3.QuestionNames.ActionManifestPath]);
|
|
1680
|
-
},
|
|
1681
|
-
},
|
|
1682
|
-
],
|
|
1683
|
-
condition: (inputs) => {
|
|
1684
|
-
return inputs[constants_3.QuestionNames.ProjectType] !== constants_3.ProjectTypeOptions.startWithGithubCopilot().id;
|
|
1685
|
-
},
|
|
1686
|
-
};
|
|
1687
|
-
return node;
|
|
1688
|
-
}
|
|
1689
|
-
exports.capabilitySubTree = capabilitySubTree;
|
|
1690
|
-
function createProjectQuestionNode() {
|
|
1691
|
-
const createProjectQuestion = {
|
|
1692
|
-
data: { type: "group" },
|
|
1693
|
-
children: [
|
|
1694
|
-
{
|
|
1695
|
-
condition: (inputs) => featureFlags_1.featureFlagManager.getBooleanValue(featureFlags_1.FeatureFlags.CLIDotNet) &&
|
|
1696
|
-
teamsfx_api_1.CLIPlatforms.includes(inputs.platform),
|
|
1697
|
-
data: runtimeQuestion(),
|
|
1698
|
-
},
|
|
1699
|
-
{
|
|
1700
|
-
condition: (inputs) => inputs.platform === teamsfx_api_1.Platform.VSCode || inputs.platform === teamsfx_api_1.Platform.CLI,
|
|
1701
|
-
data: projectTypeQuestion(),
|
|
1702
|
-
cliOptionDisabled: "self",
|
|
1703
|
-
},
|
|
1704
|
-
capabilitySubTree(),
|
|
1705
|
-
{
|
|
1706
|
-
condition: (inputs) => inputs.teamsAppFromTdp && (0, utils_1.isPersonalApp)(inputs.teamsAppFromTdp),
|
|
1707
|
-
data: { type: "group", name: constants_3.QuestionNames.RepalceTabUrl },
|
|
1708
|
-
cliOptionDisabled: "all",
|
|
1709
|
-
inputsDisabled: "all",
|
|
1710
|
-
children: [
|
|
1711
|
-
{
|
|
1712
|
-
condition: (inputs) => {
|
|
1713
|
-
var _a;
|
|
1714
|
-
return (((_a = inputs.teamsAppFromTdp) === null || _a === void 0 ? void 0 : _a.staticTabs.filter((o) => !!o.websiteUrl)) || [])
|
|
1715
|
-
.length > 0;
|
|
1716
|
-
},
|
|
1717
|
-
data: selectTabWebsiteUrlQuestion(),
|
|
1718
|
-
},
|
|
1719
|
-
{
|
|
1720
|
-
condition: (inputs) => {
|
|
1721
|
-
var _a;
|
|
1722
|
-
return (((_a = inputs.teamsAppFromTdp) === null || _a === void 0 ? void 0 : _a.staticTabs.filter((o) => !!o.contentUrl)) || [])
|
|
1723
|
-
.length > 0;
|
|
1724
|
-
},
|
|
1725
|
-
data: (0, exports.selectTabsContentUrlQuestion)(),
|
|
1726
|
-
},
|
|
1727
|
-
],
|
|
1728
|
-
},
|
|
1729
|
-
{
|
|
1730
|
-
condition: (inputs) => {
|
|
1731
|
-
const appDef = inputs.teamsAppFromTdp;
|
|
1732
|
-
return appDef && (0, utils_1.needBotCode)(appDef);
|
|
1733
|
-
},
|
|
1734
|
-
data: selectBotIdsQuestion(),
|
|
1735
|
-
cliOptionDisabled: "all",
|
|
1736
|
-
inputsDisabled: "all",
|
|
1737
|
-
},
|
|
1738
|
-
],
|
|
1739
|
-
};
|
|
1740
|
-
return createProjectQuestion;
|
|
1741
|
-
}
|
|
1742
|
-
exports.createProjectQuestionNode = createProjectQuestionNode;
|
|
1743
1347
|
function createSampleProjectQuestionNode() {
|
|
1744
1348
|
return {
|
|
1745
1349
|
data: sampleSelectQuestion(),
|