@microsoft/teamsfx-core 2.0.8-alpha.2f5decfcc.0 → 2.0.8-alpha.42af26ca6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/common/constants.d.ts +2 -2
- package/build/common/constants.d.ts.map +1 -1
- package/build/common/constants.js +2 -2
- package/build/common/constants.js.map +1 -1
- package/build/common/featureFlags.d.ts +2 -1
- package/build/common/featureFlags.d.ts.map +1 -1
- package/build/common/featureFlags.js +63 -6
- package/build/common/featureFlags.js.map +1 -1
- package/build/common/projectSettingsHelper.d.ts +7 -2
- package/build/common/projectSettingsHelper.d.ts.map +1 -1
- package/build/common/projectSettingsHelper.js +25 -7
- package/build/common/projectSettingsHelper.js.map +1 -1
- package/build/common/projectTypeChecker.d.ts +2 -0
- package/build/common/projectTypeChecker.d.ts.map +1 -1
- package/build/common/projectTypeChecker.js +10 -0
- package/build/common/projectTypeChecker.js.map +1 -1
- package/build/common/samples.d.ts +1 -2
- package/build/common/samples.d.ts.map +1 -1
- package/build/common/samples.js +37 -83
- package/build/common/samples.js.map +1 -1
- package/build/common/telemetry.d.ts +5 -1
- package/build/common/telemetry.d.ts.map +1 -1
- package/build/common/telemetry.js +13 -5
- package/build/common/telemetry.js.map +1 -1
- package/build/common/templates-config.json +1 -1
- package/build/common/wrappedAxiosClient.d.ts.map +1 -1
- package/build/common/wrappedAxiosClient.js +7 -5
- package/build/common/wrappedAxiosClient.js.map +1 -1
- package/build/component/configManager/constant.d.ts +2 -1
- package/build/component/configManager/constant.d.ts.map +1 -1
- package/build/component/configManager/constant.js +1 -0
- package/build/component/configManager/constant.js.map +1 -1
- package/build/component/configManager/validator.js +1 -1
- package/build/component/configManager/validator.js.map +1 -1
- package/build/component/coordinator/index.d.ts.map +1 -1
- package/build/component/coordinator/index.js +21 -35
- package/build/component/coordinator/index.js.map +1 -1
- package/build/component/driver/aad/create.d.ts +1 -0
- package/build/component/driver/aad/create.d.ts.map +1 -1
- package/build/component/driver/aad/create.js +22 -11
- package/build/component/driver/aad/create.js.map +1 -1
- package/build/component/driver/aad/error/aadManifestError.d.ts +6 -0
- package/build/component/driver/aad/error/aadManifestError.d.ts.map +1 -1
- package/build/component/driver/aad/error/aadManifestError.js +25 -1
- package/build/component/driver/aad/error/aadManifestError.js.map +1 -1
- package/build/component/driver/aad/error/clientSecretNotAllowedError.d.ts +5 -0
- package/build/component/driver/aad/error/clientSecretNotAllowedError.d.ts.map +1 -0
- package/build/component/driver/aad/error/clientSecretNotAllowedError.js +23 -0
- package/build/component/driver/aad/error/clientSecretNotAllowedError.js.map +1 -0
- package/build/component/driver/aad/error/credentialInvalidLifetimeError.d.ts +5 -0
- package/build/component/driver/aad/error/credentialInvalidLifetimeError.d.ts.map +1 -0
- package/build/component/driver/aad/error/credentialInvalidLifetimeError.js +23 -0
- package/build/component/driver/aad/error/credentialInvalidLifetimeError.js.map +1 -0
- package/build/component/driver/aad/interface/IAADDefinition.d.ts +1 -0
- package/build/component/driver/aad/interface/IAADDefinition.d.ts.map +1 -1
- package/build/component/driver/aad/interface/createAadAppArgs.d.ts +3 -0
- package/build/component/driver/aad/interface/createAadAppArgs.d.ts.map +1 -1
- package/build/component/driver/aad/permissions/index.d.ts.map +1 -1
- package/build/component/driver/aad/permissions/index.js +9 -0
- package/build/component/driver/aad/permissions/index.js.map +1 -1
- package/build/component/driver/aad/utility/aadAppClient.d.ts +3 -2
- package/build/component/driver/aad/utility/aadAppClient.d.ts.map +1 -1
- package/build/component/driver/aad/utility/aadAppClient.js +35 -17
- package/build/component/driver/aad/utility/aadAppClient.js.map +1 -1
- package/build/component/driver/aad/utility/aadManifestHelper.d.ts.map +1 -1
- package/build/component/driver/aad/utility/aadManifestHelper.js +7 -0
- package/build/component/driver/aad/utility/aadManifestHelper.js.map +1 -1
- package/build/component/driver/aad/utility/constants.d.ts +6 -0
- package/build/component/driver/aad/utility/constants.d.ts.map +1 -1
- package/build/component/driver/aad/utility/constants.js +8 -2
- package/build/component/driver/aad/utility/constants.js.map +1 -1
- package/build/component/driver/apiKey/create.d.ts +0 -3
- package/build/component/driver/apiKey/create.d.ts.map +1 -1
- package/build/component/driver/apiKey/create.js +23 -51
- package/build/component/driver/apiKey/create.js.map +1 -1
- package/build/component/driver/apiKey/interface/createApiKeyArgs.d.ts +2 -0
- package/build/component/driver/apiKey/interface/createApiKeyArgs.d.ts.map +1 -1
- package/build/component/driver/apiKey/interface/updateApiKeyArgs.d.ts +9 -0
- package/build/component/driver/apiKey/interface/updateApiKeyArgs.d.ts.map +1 -0
- package/build/component/driver/apiKey/interface/updateApiKeyArgs.js +5 -0
- package/build/component/driver/apiKey/interface/updateApiKeyArgs.js.map +1 -0
- package/build/component/driver/apiKey/update.d.ts +13 -0
- package/build/component/driver/apiKey/update.d.ts.map +1 -0
- package/build/component/driver/apiKey/update.js +182 -0
- package/build/component/driver/apiKey/update.js.map +1 -0
- package/build/component/driver/apiKey/utility/constants.d.ts +2 -0
- package/build/component/driver/apiKey/utility/constants.d.ts.map +1 -1
- package/build/component/driver/apiKey/utility/constants.js +2 -0
- package/build/component/driver/apiKey/utility/constants.js.map +1 -1
- package/build/component/driver/apiKey/utility/utility.d.ts +7 -0
- package/build/component/driver/apiKey/utility/utility.d.ts.map +1 -0
- package/build/component/driver/apiKey/utility/utility.js +56 -0
- package/build/component/driver/apiKey/utility/utility.js.map +1 -0
- package/build/component/driver/index.d.ts +1 -0
- package/build/component/driver/index.d.ts.map +1 -1
- package/build/component/driver/index.js +1 -0
- package/build/component/driver/index.js.map +1 -1
- package/build/component/driver/script/scriptDriver.js +2 -2
- package/build/component/driver/script/scriptDriver.js.map +1 -1
- package/build/component/driver/teamsApp/clients/appStudioClient.d.ts +6 -3
- package/build/component/driver/teamsApp/clients/appStudioClient.d.ts.map +1 -1
- package/build/component/driver/teamsApp/clients/appStudioClient.js +18 -2
- package/build/component/driver/teamsApp/clients/appStudioClient.js.map +1 -1
- package/build/component/driver/teamsApp/constants.d.ts +1 -0
- package/build/component/driver/teamsApp/constants.d.ts.map +1 -1
- package/build/component/driver/teamsApp/constants.js +1 -0
- package/build/component/driver/teamsApp/constants.js.map +1 -1
- package/build/component/driver/teamsApp/createAppPackage.d.ts +2 -1
- package/build/component/driver/teamsApp/createAppPackage.d.ts.map +1 -1
- package/build/component/driver/teamsApp/createAppPackage.js +36 -21
- package/build/component/driver/teamsApp/createAppPackage.js.map +1 -1
- package/build/component/driver/teamsApp/interfaces/ApiSecretRegistration.d.ts +20 -0
- package/build/component/driver/teamsApp/interfaces/ApiSecretRegistration.d.ts.map +1 -1
- package/build/component/driver/teamsApp/interfaces/ApiSecretRegistration.js.map +1 -1
- package/build/component/driver/teamsApp/teamsappMgr.d.ts.map +1 -1
- package/build/component/driver/teamsApp/teamsappMgr.js +22 -8
- package/build/component/driver/teamsApp/teamsappMgr.js.map +1 -1
- package/build/component/driver/teamsApp/utils/telemetry.d.ts +1 -0
- package/build/component/driver/teamsApp/utils/telemetry.d.ts.map +1 -1
- package/build/component/driver/teamsApp/utils/telemetry.js +1 -0
- package/build/component/driver/teamsApp/utils/telemetry.js.map +1 -1
- package/build/component/driver/teamsApp/utils/utils.d.ts +1 -0
- package/build/component/driver/teamsApp/utils/utils.d.ts.map +1 -1
- package/build/component/driver/teamsApp/utils/utils.js +5 -1
- package/build/component/driver/teamsApp/utils/utils.js.map +1 -1
- package/build/component/driver/teamsApp/validateTestCases.d.ts +10 -1
- package/build/component/driver/teamsApp/validateTestCases.d.ts.map +1 -1
- package/build/component/driver/teamsApp/validateTestCases.js +108 -39
- package/build/component/driver/teamsApp/validateTestCases.js.map +1 -1
- package/build/component/generator/copilotPlugin/helper.d.ts.map +1 -1
- package/build/component/generator/copilotPlugin/helper.js +4 -9
- package/build/component/generator/copilotPlugin/helper.js.map +1 -1
- package/build/component/generator/generator.d.ts.map +1 -1
- package/build/component/generator/generator.js +1 -0
- package/build/component/generator/generator.js.map +1 -1
- package/build/component/generator/officeAddin/generator.d.ts +7 -2
- package/build/component/generator/officeAddin/generator.d.ts.map +1 -1
- package/build/component/generator/officeAddin/generator.js +64 -43
- package/build/component/generator/officeAddin/generator.js.map +1 -1
- package/build/component/generator/officeXMLAddin/generator.d.ts +6 -2
- package/build/component/generator/officeXMLAddin/generator.d.ts.map +1 -1
- package/build/component/generator/officeXMLAddin/generator.js +36 -19
- package/build/component/generator/officeXMLAddin/generator.js.map +1 -1
- package/build/component/generator/officeXMLAddin/projectConfig.d.ts +21 -33
- package/build/component/generator/officeXMLAddin/projectConfig.d.ts.map +1 -1
- package/build/component/generator/officeXMLAddin/projectConfig.js +85 -86
- package/build/component/generator/officeXMLAddin/projectConfig.js.map +1 -1
- package/build/component/utils/metadataGraphPermssion.d.ts +8 -6
- package/build/component/utils/metadataGraphPermssion.d.ts.map +1 -1
- package/build/component/utils/metadataGraphPermssion.js +10 -2
- package/build/component/utils/metadataGraphPermssion.js.map +1 -1
- package/build/component/utils/metadataRscPermission.d.ts +16 -0
- package/build/component/utils/metadataRscPermission.d.ts.map +1 -0
- package/build/component/utils/metadataRscPermission.js +69 -0
- package/build/component/utils/metadataRscPermission.js.map +1 -0
- package/build/component/utils/metadataUtil.d.ts.map +1 -1
- package/build/component/utils/metadataUtil.js +2 -0
- package/build/component/utils/metadataUtil.js.map +1 -1
- package/build/core/FxCore.d.ts +1 -2
- package/build/core/FxCore.d.ts.map +1 -1
- package/build/core/FxCore.js +14 -4
- package/build/core/FxCore.js.map +1 -1
- package/build/error/script.d.ts +2 -2
- package/build/error/script.d.ts.map +1 -1
- package/build/error/script.js +6 -6
- package/build/error/script.js.map +1 -1
- package/build/question/constants.d.ts.map +1 -1
- package/build/question/constants.js +1 -1
- package/build/question/constants.js.map +1 -1
- package/build/question/create.d.ts +15 -8
- package/build/question/create.d.ts.map +1 -1
- package/build/question/create.js +274 -216
- package/build/question/create.js.map +1 -1
- package/build/question/inputs/CreateProjectInputs.d.ts +6 -6
- package/build/question/inputs/CreateProjectInputs.d.ts.map +1 -1
- package/build/question/options/CreateProjectOptions.d.ts.map +1 -1
- package/build/question/options/CreateProjectOptions.js +27 -11
- package/build/question/options/CreateProjectOptions.js.map +1 -1
- package/build/question/questionNames.d.ts +0 -1
- package/build/question/questionNames.d.ts.map +1 -1
- package/build/question/questionNames.js +0 -1
- package/build/question/questionNames.js.map +1 -1
- package/package.json +5 -4
- package/resource/package.nls.json +33 -17
- package/resource/yaml-schema/v1.5/yaml.schema.json +1663 -0
- package/resource/yaml-schema/yaml.schema.json +77 -2
- package/templates/fallback/common.zip +0 -0
- package/templates/fallback/csharp.zip +0 -0
- package/templates/fallback/js.zip +0 -0
- package/templates/fallback/python.zip +0 -0
- package/templates/fallback/ts.zip +0 -0
- package/build/component/generator/officeAddin/config/projectsJsonData.d.ts +0 -26
- package/build/component/generator/officeAddin/config/projectsJsonData.d.ts.map +0 -1
- package/build/component/generator/officeAddin/config/projectsJsonData.js +0 -165
- package/build/component/generator/officeAddin/config/projectsJsonData.js.map +0 -1
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.createProjectCliHelpNode = exports.createSampleProjectQuestionNode = exports.createProjectQuestionNode = exports.capabilitySubTree = exports.CustomCopilotAssistantOptions = exports.CustomCopilotRagOptions = exports.apiOperationQuestion = exports.apiMessageExtensionAuthQuestion = exports.openAIPluginManifestLocationQuestion = exports.apiSpecLocationQuestion = exports.ApiMessageExtensionAuthOptions = exports.RuntimeOptions = exports.appNameQuestion = exports.AppNamePattern = exports.folderQuestion = exports.programmingLanguageQuestion = exports.ProgrammingLanguage = exports.getLanguageOptions = exports.
|
|
5
|
+
exports.createProjectCliHelpNode = exports.createSampleProjectQuestionNode = exports.createProjectQuestionNode = exports.capabilitySubTree = exports.CustomCopilotAssistantOptions = exports.CustomCopilotRagOptions = exports.apiOperationQuestion = exports.apiMessageExtensionAuthQuestion = exports.openAIPluginManifestLocationQuestion = exports.apiSpecLocationQuestion = exports.ApiMessageExtensionAuthOptions = exports.RuntimeOptions = exports.appNameQuestion = exports.AppNamePattern = exports.folderQuestion = exports.programmingLanguageQuestion = exports.ProgrammingLanguage = exports.getLanguageOptions = exports.getOfficeAddinFramework = exports.getAddinFrameworkOptions = exports.officeAddinFrameworkQuestion = exports.officeAddinHostingQuestion = exports.SPFxImportFolderQuestion = exports.SPFxVersionOptionIds = exports.SPFxWebpartNameQuestion = exports.SPFxFrameworkQuestion = exports.SPFxPackageSelectQuestion = exports.NotificationTriggerOptions = exports.meArchitectureQuestion = exports.MeArchitectureOptions = exports.capabilityQuestion = exports.CapabilityOptions = exports.OfficeAddinHostOptions = exports.ProjectTypeOptions = exports.ScratchOptions = void 0;
|
|
6
6
|
const tslib_1 = require("tslib");
|
|
7
7
|
const teamsfx_api_1 = require("@microsoft/teamsfx-api");
|
|
8
8
|
const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
|
|
@@ -11,6 +11,7 @@ const lodash_1 = require("lodash");
|
|
|
11
11
|
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
|
+
const correlator_1 = require("../common/correlator");
|
|
14
15
|
const featureFlags_1 = require("../common/featureFlags");
|
|
15
16
|
const localizeUtils_1 = require("../common/localizeUtils");
|
|
16
17
|
const samples_1 = require("../common/samples");
|
|
@@ -18,18 +19,16 @@ const utils_1 = require("../common/utils");
|
|
|
18
19
|
const developerPortalScaffoldUtils_1 = require("../component/developerPortalScaffoldUtils");
|
|
19
20
|
const utils_2 = require("../component/driver/teamsApp/utils/utils");
|
|
20
21
|
const helper_1 = require("../component/generator/copilotPlugin/helper");
|
|
21
|
-
const
|
|
22
|
+
const projectConfig_1 = require("../component/generator/officeXMLAddin/projectConfig");
|
|
22
23
|
const error_1 = require("../component/generator/spfx/error");
|
|
23
24
|
const spfxGenerator_1 = require("../component/generator/spfx/spfxGenerator");
|
|
24
25
|
const constants_2 = require("../component/generator/spfx/utils/constants");
|
|
25
26
|
const utils_3 = require("../component/generator/spfx/utils/utils");
|
|
26
27
|
const utils_4 = require("../component/utils");
|
|
27
28
|
const error_2 = require("../error");
|
|
29
|
+
const constants_3 = require("./constants");
|
|
28
30
|
const questionNames_1 = require("./questionNames");
|
|
29
31
|
const util_1 = require("./util");
|
|
30
|
-
const constants_3 = require("./constants");
|
|
31
|
-
const correlator_1 = require("../common/correlator");
|
|
32
|
-
const projectConfig_1 = require("../component/generator/officeXMLAddin/projectConfig");
|
|
33
32
|
class ScratchOptions {
|
|
34
33
|
static yes() {
|
|
35
34
|
return {
|
|
@@ -84,7 +83,7 @@ class ProjectTypeOptions {
|
|
|
84
83
|
static officeXMLAddin(platform) {
|
|
85
84
|
return {
|
|
86
85
|
id: "office-xml-addin-type",
|
|
87
|
-
label: `${platform === teamsfx_api_1.Platform.VSCode ? "$(
|
|
86
|
+
label: `${platform === teamsfx_api_1.Platform.VSCode ? "$(teamsfx-m365) " : ""}${localizeUtils_1.getLocalizedString("core.createProjectQuestion.officeXMLAddin.mainEntry.title")}`,
|
|
88
87
|
detail: localizeUtils_1.getLocalizedString("core.createProjectQuestion.officeXMLAddin.mainEntry.detail"),
|
|
89
88
|
};
|
|
90
89
|
}
|
|
@@ -95,6 +94,13 @@ class ProjectTypeOptions {
|
|
|
95
94
|
detail: localizeUtils_1.getLocalizedString("core.createProjectQuestion.projectType.officeAddin.detail"),
|
|
96
95
|
};
|
|
97
96
|
}
|
|
97
|
+
static officeAddinAllIds(platform) {
|
|
98
|
+
return [
|
|
99
|
+
ProjectTypeOptions.officeAddin(platform).id,
|
|
100
|
+
ProjectTypeOptions.officeXMLAddin(platform).id,
|
|
101
|
+
ProjectTypeOptions.outlookAddin(platform).id,
|
|
102
|
+
];
|
|
103
|
+
}
|
|
98
104
|
static copilotPlugin(platform) {
|
|
99
105
|
return {
|
|
100
106
|
id: "copilot-plugin-type",
|
|
@@ -116,10 +122,9 @@ function projectTypeQuestion() {
|
|
|
116
122
|
ProjectTypeOptions.bot(teamsfx_api_1.Platform.CLI),
|
|
117
123
|
ProjectTypeOptions.tab(teamsfx_api_1.Platform.CLI),
|
|
118
124
|
ProjectTypeOptions.me(teamsfx_api_1.Platform.CLI),
|
|
119
|
-
|
|
120
|
-
? ProjectTypeOptions.officeXMLAddin(teamsfx_api_1.Platform.CLI)
|
|
121
|
-
: ProjectTypeOptions.outlookAddin(teamsfx_api_1.Platform.CLI),
|
|
125
|
+
ProjectTypeOptions.officeXMLAddin(teamsfx_api_1.Platform.CLI),
|
|
122
126
|
ProjectTypeOptions.officeAddin(teamsfx_api_1.Platform.CLI),
|
|
127
|
+
ProjectTypeOptions.outlookAddin(teamsfx_api_1.Platform.CLI),
|
|
123
128
|
];
|
|
124
129
|
return {
|
|
125
130
|
name: questionNames_1.QuestionNames.ProjectType,
|
|
@@ -154,12 +159,29 @@ function projectTypeQuestion() {
|
|
|
154
159
|
skipSingleOption: true,
|
|
155
160
|
};
|
|
156
161
|
}
|
|
157
|
-
class
|
|
162
|
+
class OfficeAddinHostOptions {
|
|
163
|
+
static all(platform) {
|
|
164
|
+
return [
|
|
165
|
+
OfficeAddinHostOptions.outlook(platform),
|
|
166
|
+
OfficeAddinHostOptions.word(),
|
|
167
|
+
OfficeAddinHostOptions.excel(),
|
|
168
|
+
OfficeAddinHostOptions.powerpoint(),
|
|
169
|
+
];
|
|
170
|
+
}
|
|
171
|
+
static outlook(platform) {
|
|
172
|
+
return {
|
|
173
|
+
id: "outlook",
|
|
174
|
+
label: `${platform === teamsfx_api_1.Platform.VSCode ? "$(mail) " : ""}${localizeUtils_1.getLocalizedString("core.createProjectQuestion.projectType.outlookAddin.label")}`,
|
|
175
|
+
detail: localizeUtils_1.getLocalizedString("core.createProjectQuestion.projectType.outlookAddin.detail"),
|
|
176
|
+
data: "Outlook",
|
|
177
|
+
};
|
|
178
|
+
}
|
|
158
179
|
static word() {
|
|
159
180
|
return {
|
|
160
181
|
id: "word",
|
|
161
182
|
label: localizeUtils_1.getLocalizedString("core.createProjectQuestion.officeXMLAddin.word.title"),
|
|
162
183
|
detail: localizeUtils_1.getLocalizedString("core.createProjectQuestion.officeXMLAddin.word.detail"),
|
|
184
|
+
data: "Word",
|
|
163
185
|
};
|
|
164
186
|
}
|
|
165
187
|
static excel() {
|
|
@@ -167,6 +189,7 @@ class OfficeAddinCapabilityOptions {
|
|
|
167
189
|
id: "excel",
|
|
168
190
|
label: localizeUtils_1.getLocalizedString("core.createProjectQuestion.officeXMLAddin.excel.title"),
|
|
169
191
|
detail: localizeUtils_1.getLocalizedString("core.createProjectQuestion.officeXMLAddin.excel.detail"),
|
|
192
|
+
data: "Excel",
|
|
170
193
|
};
|
|
171
194
|
}
|
|
172
195
|
static powerpoint() {
|
|
@@ -174,10 +197,11 @@ class OfficeAddinCapabilityOptions {
|
|
|
174
197
|
id: "powerpoint",
|
|
175
198
|
label: localizeUtils_1.getLocalizedString("core.createProjectQuestion.officeXMLAddin.powerpoint.title"),
|
|
176
199
|
detail: localizeUtils_1.getLocalizedString("core.createProjectQuestion.officeXMLAddin.powerpoint.detail"),
|
|
200
|
+
data: "PowerPoint",
|
|
177
201
|
};
|
|
178
202
|
}
|
|
179
203
|
}
|
|
180
|
-
exports.
|
|
204
|
+
exports.OfficeAddinHostOptions = OfficeAddinHostOptions;
|
|
181
205
|
class CapabilityOptions {
|
|
182
206
|
// bot
|
|
183
207
|
static basicBot() {
|
|
@@ -399,8 +423,61 @@ class CapabilityOptions {
|
|
|
399
423
|
CapabilityOptions.linkUnfurling(),
|
|
400
424
|
];
|
|
401
425
|
}
|
|
402
|
-
static
|
|
403
|
-
|
|
426
|
+
static officeAddinStaticCapabilities(host) {
|
|
427
|
+
const items = [];
|
|
428
|
+
for (const h of Object.keys(projectConfig_1.OfficeAddinProjectConfig)) {
|
|
429
|
+
if (host && h !== host)
|
|
430
|
+
continue;
|
|
431
|
+
const hostValue = projectConfig_1.OfficeAddinProjectConfig[h];
|
|
432
|
+
for (const capability of Object.keys(hostValue)) {
|
|
433
|
+
const capabilityValue = hostValue[capability];
|
|
434
|
+
items.push({
|
|
435
|
+
id: capability,
|
|
436
|
+
label: localizeUtils_1.getLocalizedString(capabilityValue.title),
|
|
437
|
+
detail: localizeUtils_1.getLocalizedString(capabilityValue.detail),
|
|
438
|
+
});
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
return items;
|
|
442
|
+
}
|
|
443
|
+
static officeAddinDynamicCapabilities(projectType, host) {
|
|
444
|
+
const items = [];
|
|
445
|
+
const isOutlookAddin = projectType === ProjectTypeOptions.outlookAddin().id;
|
|
446
|
+
const isOfficeAddin = projectType === ProjectTypeOptions.officeAddin().id;
|
|
447
|
+
const isOfficeXMLAddinForOutlook = projectType === ProjectTypeOptions.officeXMLAddin().id &&
|
|
448
|
+
host === OfficeAddinHostOptions.outlook().id;
|
|
449
|
+
const pushToItems = (option) => {
|
|
450
|
+
const capabilityValue = projectConfig_1.OfficeAddinProjectConfig.json[option];
|
|
451
|
+
items.push({
|
|
452
|
+
id: option,
|
|
453
|
+
label: localizeUtils_1.getLocalizedString(capabilityValue.title),
|
|
454
|
+
detail: localizeUtils_1.getLocalizedString(capabilityValue.detail),
|
|
455
|
+
});
|
|
456
|
+
};
|
|
457
|
+
if (isOutlookAddin || isOfficeAddin || isOfficeXMLAddinForOutlook) {
|
|
458
|
+
pushToItems("json-taskpane");
|
|
459
|
+
if (isOutlookAddin || isOfficeXMLAddinForOutlook) {
|
|
460
|
+
items.push(CapabilityOptions.outlookAddinImport());
|
|
461
|
+
}
|
|
462
|
+
else if (isOfficeAddin) {
|
|
463
|
+
items.push(CapabilityOptions.officeContentAddin());
|
|
464
|
+
items.push(CapabilityOptions.officeAddinImport());
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
else {
|
|
468
|
+
if (host) {
|
|
469
|
+
const hostValue = projectConfig_1.OfficeAddinProjectConfig[host];
|
|
470
|
+
for (const capability of Object.keys(hostValue)) {
|
|
471
|
+
const capabilityValue = hostValue[capability];
|
|
472
|
+
items.push({
|
|
473
|
+
id: capability,
|
|
474
|
+
label: localizeUtils_1.getLocalizedString(capabilityValue.title),
|
|
475
|
+
detail: localizeUtils_1.getLocalizedString(capabilityValue.detail),
|
|
476
|
+
});
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
return items;
|
|
404
481
|
}
|
|
405
482
|
static copilotPlugins() {
|
|
406
483
|
return [
|
|
@@ -412,7 +489,7 @@ class CapabilityOptions {
|
|
|
412
489
|
static customCopilots() {
|
|
413
490
|
return [
|
|
414
491
|
CapabilityOptions.customCopilotBasic(),
|
|
415
|
-
|
|
492
|
+
CapabilityOptions.customCopilotRag(),
|
|
416
493
|
CapabilityOptions.customCopilotAssistant(),
|
|
417
494
|
];
|
|
418
495
|
}
|
|
@@ -436,16 +513,7 @@ class CapabilityOptions {
|
|
|
436
513
|
...CapabilityOptions.customCopilots(),
|
|
437
514
|
...CapabilityOptions.tdpIntegrationCapabilities(),
|
|
438
515
|
];
|
|
439
|
-
|
|
440
|
-
capabilityOptions.push(...[
|
|
441
|
-
...CapabilityOptions.officeXMLAddinHostOptionItems(OfficeAddinCapabilityOptions.word().id),
|
|
442
|
-
...CapabilityOptions.officeXMLAddinHostOptionItems(OfficeAddinCapabilityOptions.excel().id),
|
|
443
|
-
...CapabilityOptions.officeXMLAddinHostOptionItems(OfficeAddinCapabilityOptions.powerpoint().id),
|
|
444
|
-
]);
|
|
445
|
-
}
|
|
446
|
-
else {
|
|
447
|
-
capabilityOptions.push(...CapabilityOptions.outlookAddinItems());
|
|
448
|
-
}
|
|
516
|
+
capabilityOptions.push(...CapabilityOptions.officeAddinStaticCapabilities());
|
|
449
517
|
return capabilityOptions;
|
|
450
518
|
}
|
|
451
519
|
/**
|
|
@@ -456,7 +524,6 @@ class CapabilityOptions {
|
|
|
456
524
|
...CapabilityOptions.bots(inputs),
|
|
457
525
|
...CapabilityOptions.tabs(),
|
|
458
526
|
...CapabilityOptions.collectMECaps(),
|
|
459
|
-
...CapabilityOptions.outlookAddinItems(),
|
|
460
527
|
];
|
|
461
528
|
if (featureFlags_1.isApiCopilotPluginEnabled()) {
|
|
462
529
|
capabilityOptions.push(...CapabilityOptions.copilotPlugins());
|
|
@@ -466,45 +533,66 @@ class CapabilityOptions {
|
|
|
466
533
|
// test templates that are used by TDP integration only
|
|
467
534
|
capabilityOptions.push(...CapabilityOptions.tdpIntegrationCapabilities());
|
|
468
535
|
}
|
|
536
|
+
capabilityOptions.push(...CapabilityOptions.officeAddinDynamicCapabilities(inputs === null || inputs === void 0 ? void 0 : inputs.projectType, inputs === null || inputs === void 0 ? void 0 : inputs.host));
|
|
537
|
+
// if (isOfficeXMLAddinEnabled()) {
|
|
538
|
+
// capabilityOptions.push(
|
|
539
|
+
// ...[
|
|
540
|
+
// ...CapabilityOptions.officeAddinStaticCapabilities("word"),
|
|
541
|
+
// ...CapabilityOptions.officeAddinStaticCapabilities("excel"),
|
|
542
|
+
// ...CapabilityOptions.officeAddinStaticCapabilities("powerpoint"),
|
|
543
|
+
// ]
|
|
544
|
+
// );
|
|
545
|
+
// } else {
|
|
546
|
+
// capabilityOptions.push(...CapabilityOptions.officeAddinStaticCapabilities("json"));
|
|
547
|
+
// }
|
|
469
548
|
return capabilityOptions;
|
|
470
549
|
}
|
|
471
550
|
static outlookAddinImport() {
|
|
472
551
|
return {
|
|
473
|
-
id: "import",
|
|
552
|
+
id: "outlook-addin-import",
|
|
474
553
|
label: localizeUtils_1.getLocalizedString("core.importAddin.label"),
|
|
475
554
|
detail: localizeUtils_1.getLocalizedString("core.importAddin.detail"),
|
|
476
555
|
};
|
|
477
556
|
}
|
|
478
557
|
static officeAddinImport() {
|
|
479
558
|
return {
|
|
480
|
-
id: "import",
|
|
559
|
+
id: "office-addin-import",
|
|
481
560
|
label: localizeUtils_1.getLocalizedString("core.importOfficeAddin.label"),
|
|
482
561
|
detail: localizeUtils_1.getLocalizedString("core.importAddin.detail"),
|
|
483
562
|
description: localizeUtils_1.getLocalizedString("core.createProjectQuestion.option.description.previewOnWindow"),
|
|
484
563
|
};
|
|
485
564
|
}
|
|
486
|
-
static
|
|
487
|
-
return
|
|
488
|
-
id:
|
|
489
|
-
label: localizeUtils_1.getLocalizedString(
|
|
490
|
-
detail: localizeUtils_1.getLocalizedString(
|
|
491
|
-
}
|
|
492
|
-
}
|
|
493
|
-
static outlookAddinItems() {
|
|
494
|
-
return officeAddinJsonData.getProjectTemplateNames().map((template) => ({
|
|
495
|
-
id: template,
|
|
496
|
-
label: localizeUtils_1.getLocalizedString(officeAddinJsonData.getProjectDisplayName(template)),
|
|
497
|
-
detail: localizeUtils_1.getLocalizedString(officeAddinJsonData.getProjectDetails(template)),
|
|
498
|
-
description: localizeUtils_1.getLocalizedString("core.createProjectQuestion.option.description.previewOnWindow"),
|
|
499
|
-
}));
|
|
500
|
-
}
|
|
501
|
-
static officeAddinItems() {
|
|
502
|
-
return officeAddinJsonData.getProjectTemplateNames().map((template) => ({
|
|
503
|
-
id: template,
|
|
504
|
-
label: localizeUtils_1.getLocalizedString(officeAddinJsonData.getProjectDisplayName(template)),
|
|
505
|
-
detail: localizeUtils_1.getLocalizedString(officeAddinJsonData.getProjectDetails(template)),
|
|
506
|
-
}));
|
|
565
|
+
static officeContentAddin() {
|
|
566
|
+
return {
|
|
567
|
+
id: "office-content-addin",
|
|
568
|
+
label: localizeUtils_1.getLocalizedString("core.officeContentAddin.label"),
|
|
569
|
+
detail: localizeUtils_1.getLocalizedString("core.officeContentAddin.detail"),
|
|
570
|
+
};
|
|
507
571
|
}
|
|
572
|
+
// static officeXMLAddinHostOptionItems(host: string): OptionItem[] {
|
|
573
|
+
// return getOfficeXMLAddinHostProjectOptions(host).map((x) => ({
|
|
574
|
+
// id: x.proj,
|
|
575
|
+
// label: getLocalizedString(x.title),
|
|
576
|
+
// detail: getLocalizedString(x.detail),
|
|
577
|
+
// }));
|
|
578
|
+
// }
|
|
579
|
+
// static jsonAddinTaskpane(): OptionItem {
|
|
580
|
+
// return {
|
|
581
|
+
// id: "json-taskpane",
|
|
582
|
+
// label: getLocalizedString("core.newTaskpaneAddin.label"),
|
|
583
|
+
// detail: getLocalizedString("core.newTaskpaneAddin.detail"),
|
|
584
|
+
// description: getLocalizedString(
|
|
585
|
+
// "core.createProjectQuestion.option.description.previewOnWindow"
|
|
586
|
+
// ),
|
|
587
|
+
// };
|
|
588
|
+
// }
|
|
589
|
+
// static officeAddinItems(): OptionItem[] {
|
|
590
|
+
// return officeAddinJsonData.getProjectTemplateNames().map((template) => ({
|
|
591
|
+
// id: template,
|
|
592
|
+
// label: getLocalizedString(officeAddinJsonData.getProjectDisplayName(template)),
|
|
593
|
+
// detail: getLocalizedString(officeAddinJsonData.getProjectDetails(template)),
|
|
594
|
+
// }));
|
|
595
|
+
// }
|
|
508
596
|
static nonSsoTabAndBot() {
|
|
509
597
|
return {
|
|
510
598
|
id: "TabNonSsoAndBot",
|
|
@@ -582,19 +670,6 @@ function capabilityQuestion() {
|
|
|
582
670
|
return {
|
|
583
671
|
name: questionNames_1.QuestionNames.Capabilities,
|
|
584
672
|
title: (inputs) => {
|
|
585
|
-
// Office Add-in Capability
|
|
586
|
-
if (featureFlags_1.isOfficeXMLAddinEnabled()) {
|
|
587
|
-
switch (inputs[questionNames_1.QuestionNames.OfficeAddinCapability]) {
|
|
588
|
-
case ProjectTypeOptions.outlookAddin().id:
|
|
589
|
-
return localizeUtils_1.getLocalizedString("core.createProjectQuestion.projectType.outlookAddin.title");
|
|
590
|
-
case OfficeAddinCapabilityOptions.word().id:
|
|
591
|
-
return localizeUtils_1.getLocalizedString("core.createProjectQuestion.officeXMLAddin.word.create.title");
|
|
592
|
-
case OfficeAddinCapabilityOptions.excel().id:
|
|
593
|
-
return localizeUtils_1.getLocalizedString("core.createProjectQuestion.officeXMLAddin.excel.create.title");
|
|
594
|
-
case OfficeAddinCapabilityOptions.powerpoint().id:
|
|
595
|
-
return localizeUtils_1.getLocalizedString("core.createProjectQuestion.officeXMLAddin.powerpoint.create.title");
|
|
596
|
-
}
|
|
597
|
-
}
|
|
598
673
|
const projectType = inputs[questionNames_1.QuestionNames.ProjectType];
|
|
599
674
|
switch (projectType) {
|
|
600
675
|
case ProjectTypeOptions.bot().id:
|
|
@@ -604,9 +679,20 @@ function capabilityQuestion() {
|
|
|
604
679
|
case ProjectTypeOptions.me().id:
|
|
605
680
|
return localizeUtils_1.getLocalizedString("core.createProjectQuestion.projectType.messageExtension.title");
|
|
606
681
|
case ProjectTypeOptions.outlookAddin().id:
|
|
607
|
-
return localizeUtils_1.getLocalizedString("core.createProjectQuestion.projectType.outlookAddin.title");
|
|
608
682
|
case ProjectTypeOptions.officeAddin().id:
|
|
683
|
+
case ProjectTypeOptions.officeXMLAddin().id: {
|
|
684
|
+
switch (inputs[questionNames_1.QuestionNames.OfficeAddinHost]) {
|
|
685
|
+
case OfficeAddinHostOptions.outlook().id:
|
|
686
|
+
return localizeUtils_1.getLocalizedString("core.createProjectQuestion.projectType.outlookAddin.title");
|
|
687
|
+
case OfficeAddinHostOptions.word().id:
|
|
688
|
+
return localizeUtils_1.getLocalizedString("core.createProjectQuestion.officeXMLAddin.word.create.title");
|
|
689
|
+
case OfficeAddinHostOptions.excel().id:
|
|
690
|
+
return localizeUtils_1.getLocalizedString("core.createProjectQuestion.officeXMLAddin.excel.create.title");
|
|
691
|
+
case OfficeAddinHostOptions.powerpoint().id:
|
|
692
|
+
return localizeUtils_1.getLocalizedString("core.createProjectQuestion.officeXMLAddin.powerpoint.create.title");
|
|
693
|
+
}
|
|
609
694
|
return localizeUtils_1.getLocalizedString("core.createProjectQuestion.projectType.officeAddin.title");
|
|
695
|
+
}
|
|
610
696
|
case ProjectTypeOptions.copilotPlugin().id:
|
|
611
697
|
return localizeUtils_1.getLocalizedString("core.createProjectQuestion.projectType.copilotPlugin.title");
|
|
612
698
|
case ProjectTypeOptions.customCopilot().id:
|
|
@@ -640,7 +726,6 @@ function capabilityQuestion() {
|
|
|
640
726
|
}
|
|
641
727
|
// nodejs capabilities
|
|
642
728
|
const projectType = inputs[questionNames_1.QuestionNames.ProjectType];
|
|
643
|
-
const officeHost = inputs[questionNames_1.QuestionNames.OfficeAddinCapability];
|
|
644
729
|
if (projectType === ProjectTypeOptions.bot().id) {
|
|
645
730
|
return CapabilityOptions.bots(inputs);
|
|
646
731
|
}
|
|
@@ -650,18 +735,8 @@ function capabilityQuestion() {
|
|
|
650
735
|
else if (projectType === ProjectTypeOptions.me().id) {
|
|
651
736
|
return CapabilityOptions.mes();
|
|
652
737
|
}
|
|
653
|
-
else if (
|
|
654
|
-
(
|
|
655
|
-
projectType === ProjectTypeOptions.officeXMLAddin().id &&
|
|
656
|
-
officeHost === ProjectTypeOptions.outlookAddin().id)) {
|
|
657
|
-
return [...CapabilityOptions.outlookAddinItems(), CapabilityOptions.outlookAddinImport()];
|
|
658
|
-
}
|
|
659
|
-
else if (featureFlags_1.isOfficeXMLAddinEnabled() &&
|
|
660
|
-
projectType === ProjectTypeOptions.officeXMLAddin().id) {
|
|
661
|
-
return CapabilityOptions.officeXMLAddinHostOptionItems(officeHost);
|
|
662
|
-
}
|
|
663
|
-
else if (projectType === ProjectTypeOptions.officeAddin().id) {
|
|
664
|
-
return CapabilityOptions.officeAll();
|
|
738
|
+
else if (ProjectTypeOptions.officeAddinAllIds().includes(projectType)) {
|
|
739
|
+
return CapabilityOptions.officeAddinDynamicCapabilities(projectType, inputs[questionNames_1.QuestionNames.OfficeAddinHost]);
|
|
665
740
|
}
|
|
666
741
|
else if (projectType === ProjectTypeOptions.copilotPlugin().id) {
|
|
667
742
|
return CapabilityOptions.copilotPlugins();
|
|
@@ -1042,124 +1117,125 @@ function SPFxImportFolderQuestion(hasDefaultFunc = false) {
|
|
|
1042
1117
|
};
|
|
1043
1118
|
}
|
|
1044
1119
|
exports.SPFxImportFolderQuestion = SPFxImportFolderQuestion;
|
|
1045
|
-
const getTemplate = (inputs) => {
|
|
1046
|
-
const capabilities = inputs[questionNames_1.QuestionNames.Capabilities];
|
|
1047
|
-
const templates = officeAddinJsonData.getProjectTemplateNames();
|
|
1048
|
-
const foundTemplate = templates.find((template) => {
|
|
1049
|
-
return capabilities && capabilities.includes(template);
|
|
1050
|
-
});
|
|
1051
|
-
return foundTemplate !== null && foundTemplate !== void 0 ? foundTemplate : "";
|
|
1052
|
-
};
|
|
1053
|
-
exports.getTemplate = getTemplate;
|
|
1054
1120
|
function officeAddinHostingQuestion() {
|
|
1055
|
-
|
|
1056
|
-
type: "singleSelect",
|
|
1121
|
+
return {
|
|
1057
1122
|
name: questionNames_1.QuestionNames.OfficeAddinHost,
|
|
1058
|
-
title: "
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
default: (inputs) => {
|
|
1062
|
-
const template = exports.getTemplate(inputs);
|
|
1063
|
-
const options = officeAddinJsonData.getHostTemplateNames(template);
|
|
1064
|
-
return options[0] || "No Options";
|
|
1065
|
-
},
|
|
1066
|
-
skipSingleOption: true,
|
|
1123
|
+
title: localizeUtils_1.getLocalizedString("core.createProjectQuestion.officeXMLAddin.create.title"),
|
|
1124
|
+
type: "singleSelect",
|
|
1125
|
+
staticOptions: OfficeAddinHostOptions.all(),
|
|
1067
1126
|
};
|
|
1068
|
-
return OfficeHostQuestion;
|
|
1069
1127
|
}
|
|
1070
1128
|
exports.officeAddinHostingQuestion = officeAddinHostingQuestion;
|
|
1071
|
-
function
|
|
1072
|
-
// office addin supports host defined in officeAddinJsonData
|
|
1073
|
-
const projectType = inputs[questionNames_1.QuestionNames.ProjectType];
|
|
1074
|
-
const template = exports.getTemplate(inputs);
|
|
1075
|
-
const hostTypes = officeAddinJsonData.getHostTemplateNames(template);
|
|
1076
|
-
const options = [];
|
|
1077
|
-
hostTypes.forEach((host) => {
|
|
1078
|
-
options.push({ label: officeAddinJsonData.getHostDisplayName(host), id: host });
|
|
1079
|
-
});
|
|
1080
|
-
// Outlook addin only supports outlook
|
|
1081
|
-
if (projectType === ProjectTypeOptions.outlookAddin().id) {
|
|
1082
|
-
return [options[0] || { label: "No Options", id: "No Options" }];
|
|
1083
|
-
}
|
|
1084
|
-
else if (projectType === ProjectTypeOptions.officeAddin().id) {
|
|
1085
|
-
return options;
|
|
1086
|
-
}
|
|
1087
|
-
return options || "No Options";
|
|
1088
|
-
}
|
|
1089
|
-
exports.getAddinHostOptions = getAddinHostOptions;
|
|
1090
|
-
function OfficeAddinFrameworkQuestion() {
|
|
1129
|
+
function officeAddinFrameworkQuestion() {
|
|
1091
1130
|
return {
|
|
1092
1131
|
type: "singleSelect",
|
|
1093
1132
|
name: questionNames_1.QuestionNames.OfficeAddinFramework,
|
|
1094
1133
|
cliShortName: "f",
|
|
1095
1134
|
cliDescription: "Framework for WXP extension.",
|
|
1096
1135
|
title: localizeUtils_1.getLocalizedString("core.createProjectQuestion.projectType.officeAddin.framework.title"),
|
|
1136
|
+
dynamicOptions: getAddinFrameworkOptions,
|
|
1097
1137
|
staticOptions: [
|
|
1098
1138
|
{ id: "default", label: "Default" },
|
|
1099
1139
|
{ id: "react", label: "React" },
|
|
1100
1140
|
],
|
|
1101
1141
|
placeholder: localizeUtils_1.getLocalizedString("core.createProjectQuestion.projectType.officeAddin.framework.placeholder"),
|
|
1102
|
-
|
|
1142
|
+
skipSingleOption: true,
|
|
1103
1143
|
};
|
|
1104
1144
|
}
|
|
1105
|
-
exports.
|
|
1106
|
-
|
|
1145
|
+
exports.officeAddinFrameworkQuestion = officeAddinFrameworkQuestion;
|
|
1146
|
+
function getAddinFrameworkOptions(inputs) {
|
|
1147
|
+
const projectType = inputs[questionNames_1.QuestionNames.ProjectType];
|
|
1148
|
+
const capabilities = inputs[questionNames_1.QuestionNames.Capabilities];
|
|
1149
|
+
const host = inputs[questionNames_1.QuestionNames.OfficeAddinHost];
|
|
1150
|
+
if (projectType === ProjectTypeOptions.outlookAddin().id ||
|
|
1151
|
+
(projectType === ProjectTypeOptions.officeXMLAddin().id &&
|
|
1152
|
+
host === OfficeAddinHostOptions.outlook().id)) {
|
|
1153
|
+
return [{ id: "default", label: "Default" }];
|
|
1154
|
+
}
|
|
1155
|
+
else if ((projectType === ProjectTypeOptions.officeAddin().id &&
|
|
1156
|
+
capabilities === CapabilityOptions.officeContentAddin().id) ||
|
|
1157
|
+
capabilities === CapabilityOptions.officeAddinImport().id) {
|
|
1158
|
+
return [{ id: "default", label: "Default" }];
|
|
1159
|
+
}
|
|
1160
|
+
else {
|
|
1161
|
+
return [
|
|
1162
|
+
{ id: "default", label: "Default" },
|
|
1163
|
+
{ id: "react", label: "React" },
|
|
1164
|
+
];
|
|
1165
|
+
}
|
|
1166
|
+
}
|
|
1167
|
+
exports.getAddinFrameworkOptions = getAddinFrameworkOptions;
|
|
1168
|
+
/**
|
|
1169
|
+
* when project-type=office-addin-type(office-addin-framework-type=default or react), use selected value;
|
|
1170
|
+
* when project-type=outlook-addin-type, no framework to select, office-addin-framework-type=default_old
|
|
1171
|
+
* when project-type=office-xml-addin-type, no framework to select, office-addin-framework-type=default_old
|
|
1172
|
+
*/
|
|
1173
|
+
function getOfficeAddinFramework(inputs) {
|
|
1174
|
+
const projectType = inputs[questionNames_1.QuestionNames.ProjectType];
|
|
1175
|
+
if (projectType === ProjectTypeOptions.officeAddin().id &&
|
|
1176
|
+
inputs[questionNames_1.QuestionNames.OfficeAddinFramework]) {
|
|
1177
|
+
return inputs[questionNames_1.QuestionNames.OfficeAddinFramework];
|
|
1178
|
+
}
|
|
1179
|
+
else if ((projectType === ProjectTypeOptions.officeXMLAddin().id &&
|
|
1180
|
+
inputs[questionNames_1.QuestionNames.OfficeAddinHost] === OfficeAddinHostOptions.outlook().id) ||
|
|
1181
|
+
projectType === ProjectTypeOptions.outlookAddin().id) {
|
|
1182
|
+
return "default_old";
|
|
1183
|
+
}
|
|
1184
|
+
else {
|
|
1185
|
+
return "default";
|
|
1186
|
+
}
|
|
1187
|
+
}
|
|
1188
|
+
exports.getOfficeAddinFramework = getOfficeAddinFramework;
|
|
1107
1189
|
function getLanguageOptions(inputs) {
|
|
1108
1190
|
const runtime = getRuntime(inputs);
|
|
1109
1191
|
// dotnet runtime only supports C#
|
|
1110
1192
|
if (runtime === RuntimeOptions.DotNet().id) {
|
|
1111
|
-
return [{ id:
|
|
1193
|
+
return [{ id: ProgrammingLanguage.CSharp, label: "C#" }];
|
|
1112
1194
|
}
|
|
1195
|
+
const capabilities = inputs[questionNames_1.QuestionNames.Capabilities];
|
|
1196
|
+
const host = inputs[questionNames_1.QuestionNames.OfficeAddinHost];
|
|
1113
1197
|
// office addin supports language defined in officeAddinJsonData
|
|
1114
1198
|
const projectType = inputs[questionNames_1.QuestionNames.ProjectType];
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
const
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
const template = exports.getTemplate(inputs);
|
|
1133
|
-
const supportedTypes = officeAddinJsonData.getSupportedScriptTypesNew(template);
|
|
1134
|
-
const options = [];
|
|
1135
|
-
supportedTypes.forEach((language) => {
|
|
1136
|
-
if (language === "TypeScript") {
|
|
1137
|
-
options.push({ label: "TypeScript", id: "typescript" });
|
|
1138
|
-
}
|
|
1139
|
-
else if (language === "JavaScript") {
|
|
1140
|
-
options.push({ label: "JavaScript", id: "javascript" });
|
|
1141
|
-
}
|
|
1142
|
-
});
|
|
1143
|
-
return options.length > 0 ? options : [{ label: "No Options", id: "No Options" }];
|
|
1199
|
+
if (ProjectTypeOptions.officeAddinAllIds().includes(projectType)) {
|
|
1200
|
+
if (capabilities.endsWith("-manifest")) {
|
|
1201
|
+
return [{ id: ProgrammingLanguage.JS, label: "JavaScript" }];
|
|
1202
|
+
}
|
|
1203
|
+
if (projectType === ProjectTypeOptions.outlookAddin().id ||
|
|
1204
|
+
(projectType === ProjectTypeOptions.officeXMLAddin().id &&
|
|
1205
|
+
host === OfficeAddinHostOptions.outlook().id)) {
|
|
1206
|
+
return [{ id: ProgrammingLanguage.TS, label: "TypeScript" }];
|
|
1207
|
+
}
|
|
1208
|
+
const officeXMLAddinLangConfig = projectConfig_1.getOfficeAddinTemplateConfig(projectType, host)[capabilities]
|
|
1209
|
+
.framework["default"];
|
|
1210
|
+
const officeXMLAddinLangOptions = [];
|
|
1211
|
+
if (!!officeXMLAddinLangConfig.typescript)
|
|
1212
|
+
officeXMLAddinLangOptions.push({ id: ProgrammingLanguage.TS, label: "TypeScript" });
|
|
1213
|
+
if (!!officeXMLAddinLangConfig.javascript)
|
|
1214
|
+
officeXMLAddinLangOptions.push({ id: ProgrammingLanguage.JS, label: "JavaScript" });
|
|
1215
|
+
return officeXMLAddinLangOptions;
|
|
1144
1216
|
}
|
|
1145
|
-
const capabilities = inputs[questionNames_1.QuestionNames.Capabilities];
|
|
1146
1217
|
if (capabilities === CapabilityOptions.SPFxTab().id) {
|
|
1147
1218
|
// SPFx only supports typescript
|
|
1148
|
-
return [{ id:
|
|
1219
|
+
return [{ id: ProgrammingLanguage.TS, label: "TypeScript" }];
|
|
1149
1220
|
}
|
|
1150
1221
|
else if (constants_3.capabilitiesHavePythonOption.includes(capabilities)) {
|
|
1151
1222
|
// support python language
|
|
1152
1223
|
return [
|
|
1153
|
-
{ id:
|
|
1154
|
-
{ id:
|
|
1155
|
-
{
|
|
1224
|
+
{ id: ProgrammingLanguage.JS, label: "JavaScript" },
|
|
1225
|
+
{ id: ProgrammingLanguage.TS, label: "TypeScript" },
|
|
1226
|
+
{
|
|
1227
|
+
id: ProgrammingLanguage.PY,
|
|
1228
|
+
label: "Python",
|
|
1229
|
+
detail: "",
|
|
1230
|
+
description: localizeUtils_1.getLocalizedString("core.createProjectQuestion.option.description.preview"),
|
|
1231
|
+
},
|
|
1156
1232
|
];
|
|
1157
1233
|
}
|
|
1158
1234
|
else {
|
|
1159
1235
|
// other cases
|
|
1160
1236
|
return [
|
|
1161
|
-
{ id:
|
|
1162
|
-
{ id:
|
|
1237
|
+
{ id: ProgrammingLanguage.JS, label: "JavaScript" },
|
|
1238
|
+
{ id: ProgrammingLanguage.TS, label: "TypeScript" },
|
|
1163
1239
|
];
|
|
1164
1240
|
}
|
|
1165
1241
|
}
|
|
@@ -1193,14 +1269,14 @@ function programmingLanguageQuestion() {
|
|
|
1193
1269
|
if (runtime === RuntimeOptions.DotNet().id) {
|
|
1194
1270
|
return "";
|
|
1195
1271
|
}
|
|
1196
|
-
// office addin
|
|
1197
|
-
const projectType = inputs[questionNames_1.QuestionNames.ProjectType];
|
|
1198
|
-
if (projectType === ProjectTypeOptions.outlookAddin().id) {
|
|
1199
|
-
const template = exports.getTemplate(inputs);
|
|
1200
|
-
const options = officeAddinJsonData.getSupportedScriptTypesNew(template);
|
|
1201
|
-
return options[0] || "No Options";
|
|
1202
|
-
}
|
|
1203
1272
|
const capabilities = inputs[questionNames_1.QuestionNames.Capabilities];
|
|
1273
|
+
// // office addin
|
|
1274
|
+
// const projectType = inputs[QuestionNames.ProjectType];
|
|
1275
|
+
// if (projectType === ProjectTypeOptions.outlookAddin().id) {
|
|
1276
|
+
// const template = getTemplate(inputs);
|
|
1277
|
+
// const options = officeAddinJsonData.getSupportedScriptTypesNew(template);
|
|
1278
|
+
// return options[0] || "No Options";
|
|
1279
|
+
// }
|
|
1204
1280
|
// SPFx
|
|
1205
1281
|
if (capabilities === CapabilityOptions.SPFxTab().id) {
|
|
1206
1282
|
return localizeUtils_1.getLocalizedString("core.ProgrammingLanguageQuestion.placeholder.spfx");
|
|
@@ -1793,8 +1869,8 @@ class CustomCopilotRagOptions {
|
|
|
1793
1869
|
return [
|
|
1794
1870
|
CustomCopilotRagOptions.customize(),
|
|
1795
1871
|
CustomCopilotRagOptions.azureAISearch(),
|
|
1796
|
-
CustomCopilotRagOptions.customApi(),
|
|
1797
|
-
CustomCopilotRagOptions.microsoft365(),
|
|
1872
|
+
// CustomCopilotRagOptions.customApi(),
|
|
1873
|
+
// CustomCopilotRagOptions.microsoft365(),
|
|
1798
1874
|
];
|
|
1799
1875
|
}
|
|
1800
1876
|
}
|
|
@@ -1937,8 +2013,13 @@ function capabilitySubTree() {
|
|
|
1937
2013
|
],
|
|
1938
2014
|
},
|
|
1939
2015
|
{
|
|
1940
|
-
// office addin import sub-tree
|
|
1941
|
-
condition: {
|
|
2016
|
+
// office addin import sub-tree (capabilities=office-addin-import | outlook-addin-import)
|
|
2017
|
+
condition: {
|
|
2018
|
+
enum: [
|
|
2019
|
+
CapabilityOptions.outlookAddinImport().id,
|
|
2020
|
+
CapabilityOptions.officeAddinImport().id,
|
|
2021
|
+
],
|
|
2022
|
+
},
|
|
1942
2023
|
data: { type: "group", name: questionNames_1.QuestionNames.OfficeAddinImport },
|
|
1943
2024
|
children: [
|
|
1944
2025
|
{
|
|
@@ -1957,15 +2038,6 @@ function capabilitySubTree() {
|
|
|
1957
2038
|
},
|
|
1958
2039
|
],
|
|
1959
2040
|
},
|
|
1960
|
-
{
|
|
1961
|
-
// office addin other items sub-tree
|
|
1962
|
-
condition: (inputs) => featureFlags_1.isOfficeXMLAddinEnabled()
|
|
1963
|
-
? false
|
|
1964
|
-
: CapabilityOptions.outlookAddinItems()
|
|
1965
|
-
.map((i) => i.id)
|
|
1966
|
-
.includes(inputs[questionNames_1.QuestionNames.Capabilities]),
|
|
1967
|
-
data: officeAddinHostingQuestion(),
|
|
1968
|
-
},
|
|
1969
2041
|
{
|
|
1970
2042
|
// Search ME sub-tree
|
|
1971
2043
|
condition: { equals: CapabilityOptions.m365SearchMe().id },
|
|
@@ -2005,32 +2077,26 @@ function capabilitySubTree() {
|
|
|
2005
2077
|
},
|
|
2006
2078
|
data: apiMessageExtensionAuthQuestion(),
|
|
2007
2079
|
},
|
|
2008
|
-
/*
|
|
2009
2080
|
{
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
},
|
|
2013
|
-
data: customCopilotRagQuestion(),
|
|
2014
|
-
children: [
|
|
2015
|
-
{
|
|
2016
|
-
condition: (inputs: Inputs) => {
|
|
2017
|
-
return (
|
|
2018
|
-
inputs[QuestionNames.CustomCopilotRag] === CustomCopilotRagOptions.customApi().id
|
|
2019
|
-
);
|
|
2020
|
-
},
|
|
2021
|
-
data: apiSpecLocationQuestion(),
|
|
2022
|
-
},
|
|
2023
|
-
{
|
|
2024
|
-
condition: (inputs: Inputs) => {
|
|
2025
|
-
return (
|
|
2026
|
-
inputs[QuestionNames.CustomCopilotRag] === CustomCopilotRagOptions.customApi().id
|
|
2027
|
-
);
|
|
2028
|
-
},
|
|
2029
|
-
data: apiOperationQuestion(),
|
|
2081
|
+
condition: (inputs) => {
|
|
2082
|
+
return inputs[questionNames_1.QuestionNames.Capabilities] == CapabilityOptions.customCopilotRag().id;
|
|
2030
2083
|
},
|
|
2031
|
-
|
|
2084
|
+
data: customCopilotRagQuestion(),
|
|
2085
|
+
children: [
|
|
2086
|
+
{
|
|
2087
|
+
condition: (inputs) => {
|
|
2088
|
+
return (inputs[questionNames_1.QuestionNames.CustomCopilotRag] === CustomCopilotRagOptions.customApi().id);
|
|
2089
|
+
},
|
|
2090
|
+
data: apiSpecLocationQuestion(),
|
|
2091
|
+
},
|
|
2092
|
+
{
|
|
2093
|
+
condition: (inputs) => {
|
|
2094
|
+
return (inputs[questionNames_1.QuestionNames.CustomCopilotRag] === CustomCopilotRagOptions.customApi().id);
|
|
2095
|
+
},
|
|
2096
|
+
data: apiOperationQuestion(),
|
|
2097
|
+
},
|
|
2098
|
+
],
|
|
2032
2099
|
},
|
|
2033
|
-
*/
|
|
2034
2100
|
{
|
|
2035
2101
|
condition: (inputs) => {
|
|
2036
2102
|
return (inputs[questionNames_1.QuestionNames.Capabilities] == CapabilityOptions.customCopilotAssistant().id);
|
|
@@ -2045,7 +2111,9 @@ function capabilitySubTree() {
|
|
|
2045
2111
|
inputs[questionNames_1.QuestionNames.Capabilities] !== CapabilityOptions.copilotPluginApiSpec().id &&
|
|
2046
2112
|
inputs[questionNames_1.QuestionNames.Capabilities] !==
|
|
2047
2113
|
CapabilityOptions.copilotPluginOpenAIPlugin().id &&
|
|
2048
|
-
inputs[questionNames_1.QuestionNames.MeArchitectureType] !== MeArchitectureOptions.apiSpec().id
|
|
2114
|
+
inputs[questionNames_1.QuestionNames.MeArchitectureType] !== MeArchitectureOptions.apiSpec().id &&
|
|
2115
|
+
inputs[questionNames_1.QuestionNames.Capabilities] !== CapabilityOptions.officeAddinImport().id &&
|
|
2116
|
+
inputs[questionNames_1.QuestionNames.Capabilities] !== CapabilityOptions.outlookAddinImport().id);
|
|
2049
2117
|
},
|
|
2050
2118
|
},
|
|
2051
2119
|
{
|
|
@@ -2076,11 +2144,12 @@ function capabilitySubTree() {
|
|
|
2076
2144
|
],
|
|
2077
2145
|
},
|
|
2078
2146
|
{
|
|
2079
|
-
//
|
|
2147
|
+
// Office addin framework for json manifest
|
|
2148
|
+
data: officeAddinFrameworkQuestion(),
|
|
2080
2149
|
condition: (inputs) => {
|
|
2081
|
-
return inputs[questionNames_1.QuestionNames.ProjectType] === ProjectTypeOptions.officeAddin().id
|
|
2150
|
+
return (inputs[questionNames_1.QuestionNames.ProjectType] === ProjectTypeOptions.officeAddin().id &&
|
|
2151
|
+
inputs[questionNames_1.QuestionNames.Capabilities] !== CapabilityOptions.officeAddinImport().id);
|
|
2082
2152
|
},
|
|
2083
|
-
data: OfficeAddinFrameworkQuestion(),
|
|
2084
2153
|
},
|
|
2085
2154
|
{
|
|
2086
2155
|
// root folder
|
|
@@ -2109,19 +2178,8 @@ function createProjectQuestionNode() {
|
|
|
2109
2178
|
cliOptionDisabled: "self",
|
|
2110
2179
|
},
|
|
2111
2180
|
{
|
|
2112
|
-
condition: (inputs) =>
|
|
2113
|
-
|
|
2114
|
-
data: {
|
|
2115
|
-
name: questionNames_1.QuestionNames.OfficeAddinCapability,
|
|
2116
|
-
title: localizeUtils_1.getLocalizedString("core.createProjectQuestion.officeXMLAddin.create.title"),
|
|
2117
|
-
type: "singleSelect",
|
|
2118
|
-
staticOptions: [
|
|
2119
|
-
ProjectTypeOptions.outlookAddin(),
|
|
2120
|
-
OfficeAddinCapabilityOptions.word(),
|
|
2121
|
-
OfficeAddinCapabilityOptions.excel(),
|
|
2122
|
-
OfficeAddinCapabilityOptions.powerpoint(),
|
|
2123
|
-
],
|
|
2124
|
-
},
|
|
2181
|
+
condition: (inputs) => inputs[questionNames_1.QuestionNames.ProjectType] === ProjectTypeOptions.officeXMLAddin().id,
|
|
2182
|
+
data: officeAddinHostingQuestion(),
|
|
2125
2183
|
},
|
|
2126
2184
|
capabilitySubTree(),
|
|
2127
2185
|
{
|