@microsoft/teamsfx-core 2.0.8-alpha.2f5decfcc.0 → 2.0.8-alpha.784d957e7.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 +1 -2
- package/build/common/constants.d.ts.map +1 -1
- package/build/common/constants.js +1 -2
- package/build/common/constants.js.map +1 -1
- package/build/common/featureFlags.d.ts.map +1 -1
- package/build/common/featureFlags.js +45 -2
- 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/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/templates-config.json +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 +20 -34
- package/build/component/coordinator/index.js.map +1 -1
- package/build/component/driver/aad/create.d.ts.map +1 -1
- package/build/component/driver/aad/create.js +11 -9
- package/build/component/driver/aad/create.js.map +1 -1
- 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/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 +9 -7
- package/build/component/driver/aad/utility/aadAppClient.js.map +1 -1
- package/build/component/driver/apiKey/create.d.ts.map +1 -1
- package/build/component/driver/apiKey/create.js +19 -2
- 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/generator/copilotPlugin/helper.d.ts.map +1 -1
- package/build/component/generator/copilotPlugin/helper.js +2 -0
- package/build/component/generator/copilotPlugin/helper.js.map +1 -1
- package/build/component/generator/officeAddin/generator.d.ts +4 -2
- package/build/component/generator/officeAddin/generator.d.ts.map +1 -1
- package/build/component/generator/officeAddin/generator.js +38 -35
- package/build/component/generator/officeAddin/generator.js.map +1 -1
- package/build/component/generator/officeXMLAddin/generator.d.ts +4 -1
- package/build/component/generator/officeXMLAddin/generator.d.ts.map +1 -1
- package/build/component/generator/officeXMLAddin/generator.js +20 -14
- 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 +73 -86
- package/build/component/generator/officeXMLAddin/projectConfig.js.map +1 -1
- package/build/core/FxCore.d.ts.map +1 -1
- package/build/core/FxCore.js +3 -0
- package/build/core/FxCore.js.map +1 -1
- package/build/question/create.d.ts +12 -7
- package/build/question/create.d.ts.map +1 -1
- package/build/question/create.js +211 -182
- package/build/question/create.js.map +1 -1
- package/build/question/inputs/CreateProjectInputs.d.ts +2 -4
- 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 +17 -9
- 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 +1 -0
- package/resource/yaml-schema/v1.5/yaml.schema.json +1605 -0
- package/resource/yaml-schema/yaml.schema.json +18 -1
- package/templates/fallback/common.zip +0 -0
- package/templates/fallback/csharp.zip +0 -0
- package/templates/fallback/js.zip +0 -0
- package/templates/fallback/python.zip +0 -0
- package/templates/fallback/ts.zip +0 -0
- 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.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 {
|
|
@@ -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",
|
|
@@ -154,12 +160,29 @@ function projectTypeQuestion() {
|
|
|
154
160
|
skipSingleOption: true,
|
|
155
161
|
};
|
|
156
162
|
}
|
|
157
|
-
class
|
|
163
|
+
class OfficeAddinHostOptions {
|
|
164
|
+
static all(platform) {
|
|
165
|
+
return [
|
|
166
|
+
OfficeAddinHostOptions.outlook(platform),
|
|
167
|
+
OfficeAddinHostOptions.word(),
|
|
168
|
+
OfficeAddinHostOptions.excel(),
|
|
169
|
+
OfficeAddinHostOptions.powerpoint(),
|
|
170
|
+
];
|
|
171
|
+
}
|
|
172
|
+
static outlook(platform) {
|
|
173
|
+
return {
|
|
174
|
+
id: "outlook",
|
|
175
|
+
label: `${platform === teamsfx_api_1.Platform.VSCode ? "$(mail) " : ""}${localizeUtils_1.getLocalizedString("core.createProjectQuestion.projectType.outlookAddin.label")}`,
|
|
176
|
+
detail: localizeUtils_1.getLocalizedString("core.createProjectQuestion.projectType.outlookAddin.detail"),
|
|
177
|
+
data: "Outlook",
|
|
178
|
+
};
|
|
179
|
+
}
|
|
158
180
|
static word() {
|
|
159
181
|
return {
|
|
160
182
|
id: "word",
|
|
161
183
|
label: localizeUtils_1.getLocalizedString("core.createProjectQuestion.officeXMLAddin.word.title"),
|
|
162
184
|
detail: localizeUtils_1.getLocalizedString("core.createProjectQuestion.officeXMLAddin.word.detail"),
|
|
185
|
+
data: "Word",
|
|
163
186
|
};
|
|
164
187
|
}
|
|
165
188
|
static excel() {
|
|
@@ -167,6 +190,7 @@ class OfficeAddinCapabilityOptions {
|
|
|
167
190
|
id: "excel",
|
|
168
191
|
label: localizeUtils_1.getLocalizedString("core.createProjectQuestion.officeXMLAddin.excel.title"),
|
|
169
192
|
detail: localizeUtils_1.getLocalizedString("core.createProjectQuestion.officeXMLAddin.excel.detail"),
|
|
193
|
+
data: "Excel",
|
|
170
194
|
};
|
|
171
195
|
}
|
|
172
196
|
static powerpoint() {
|
|
@@ -174,10 +198,11 @@ class OfficeAddinCapabilityOptions {
|
|
|
174
198
|
id: "powerpoint",
|
|
175
199
|
label: localizeUtils_1.getLocalizedString("core.createProjectQuestion.officeXMLAddin.powerpoint.title"),
|
|
176
200
|
detail: localizeUtils_1.getLocalizedString("core.createProjectQuestion.officeXMLAddin.powerpoint.detail"),
|
|
201
|
+
data: "PowerPoint",
|
|
177
202
|
};
|
|
178
203
|
}
|
|
179
204
|
}
|
|
180
|
-
exports.
|
|
205
|
+
exports.OfficeAddinHostOptions = OfficeAddinHostOptions;
|
|
181
206
|
class CapabilityOptions {
|
|
182
207
|
// bot
|
|
183
208
|
static basicBot() {
|
|
@@ -399,8 +424,60 @@ class CapabilityOptions {
|
|
|
399
424
|
CapabilityOptions.linkUnfurling(),
|
|
400
425
|
];
|
|
401
426
|
}
|
|
402
|
-
static
|
|
403
|
-
|
|
427
|
+
static officeAddinStaticCapabilities(host) {
|
|
428
|
+
const items = [];
|
|
429
|
+
for (const h of Object.keys(projectConfig_1.OfficeAddinProjectConfig)) {
|
|
430
|
+
if (host && h !== host)
|
|
431
|
+
continue;
|
|
432
|
+
const hostValue = projectConfig_1.OfficeAddinProjectConfig[h];
|
|
433
|
+
for (const capability of Object.keys(hostValue)) {
|
|
434
|
+
const capabilityValue = hostValue[capability];
|
|
435
|
+
items.push({
|
|
436
|
+
id: capability,
|
|
437
|
+
label: localizeUtils_1.getLocalizedString(capabilityValue.title),
|
|
438
|
+
detail: localizeUtils_1.getLocalizedString(capabilityValue.detail),
|
|
439
|
+
});
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
return items;
|
|
443
|
+
}
|
|
444
|
+
static officeAddinDynamicCapabilities(projectType, host) {
|
|
445
|
+
const items = [];
|
|
446
|
+
const isOutlookAddin = projectType === ProjectTypeOptions.outlookAddin().id;
|
|
447
|
+
const isOfficeAddin = projectType === ProjectTypeOptions.officeAddin().id;
|
|
448
|
+
const isOfficeXMLAddinForOutlook = projectType === ProjectTypeOptions.officeXMLAddin().id &&
|
|
449
|
+
host === OfficeAddinHostOptions.outlook().id;
|
|
450
|
+
const pushToItems = (option) => {
|
|
451
|
+
const capabilityValue = projectConfig_1.OfficeAddinProjectConfig.json[option];
|
|
452
|
+
items.push({
|
|
453
|
+
id: option,
|
|
454
|
+
label: localizeUtils_1.getLocalizedString(capabilityValue.title),
|
|
455
|
+
detail: localizeUtils_1.getLocalizedString(capabilityValue.detail),
|
|
456
|
+
});
|
|
457
|
+
};
|
|
458
|
+
if (isOutlookAddin || isOfficeAddin || isOfficeXMLAddinForOutlook) {
|
|
459
|
+
pushToItems("json-taskpane");
|
|
460
|
+
if (isOutlookAddin || isOfficeXMLAddinForOutlook) {
|
|
461
|
+
items.push(CapabilityOptions.outlookAddinImport());
|
|
462
|
+
}
|
|
463
|
+
else if (isOfficeAddin) {
|
|
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 [
|
|
@@ -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,59 @@ 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 officeXMLAddinHostOptionItems(host) {
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
}
|
|
493
|
-
static
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
565
|
+
// static officeXMLAddinHostOptionItems(host: string): OptionItem[] {
|
|
566
|
+
// return getOfficeXMLAddinHostProjectOptions(host).map((x) => ({
|
|
567
|
+
// id: x.proj,
|
|
568
|
+
// label: getLocalizedString(x.title),
|
|
569
|
+
// detail: getLocalizedString(x.detail),
|
|
570
|
+
// }));
|
|
571
|
+
// }
|
|
572
|
+
// static jsonAddinTaskpane(): OptionItem {
|
|
573
|
+
// return {
|
|
574
|
+
// id: "json-taskpane",
|
|
575
|
+
// label: getLocalizedString("core.newTaskpaneAddin.label"),
|
|
576
|
+
// detail: getLocalizedString("core.newTaskpaneAddin.detail"),
|
|
577
|
+
// description: getLocalizedString(
|
|
578
|
+
// "core.createProjectQuestion.option.description.previewOnWindow"
|
|
579
|
+
// ),
|
|
580
|
+
// };
|
|
581
|
+
// }
|
|
582
|
+
// static officeAddinItems(): OptionItem[] {
|
|
583
|
+
// return officeAddinJsonData.getProjectTemplateNames().map((template) => ({
|
|
584
|
+
// id: template,
|
|
585
|
+
// label: getLocalizedString(officeAddinJsonData.getProjectDisplayName(template)),
|
|
586
|
+
// detail: getLocalizedString(officeAddinJsonData.getProjectDetails(template)),
|
|
587
|
+
// }));
|
|
588
|
+
// }
|
|
508
589
|
static nonSsoTabAndBot() {
|
|
509
590
|
return {
|
|
510
591
|
id: "TabNonSsoAndBot",
|
|
@@ -582,19 +663,6 @@ function capabilityQuestion() {
|
|
|
582
663
|
return {
|
|
583
664
|
name: questionNames_1.QuestionNames.Capabilities,
|
|
584
665
|
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
666
|
const projectType = inputs[questionNames_1.QuestionNames.ProjectType];
|
|
599
667
|
switch (projectType) {
|
|
600
668
|
case ProjectTypeOptions.bot().id:
|
|
@@ -604,9 +672,20 @@ function capabilityQuestion() {
|
|
|
604
672
|
case ProjectTypeOptions.me().id:
|
|
605
673
|
return localizeUtils_1.getLocalizedString("core.createProjectQuestion.projectType.messageExtension.title");
|
|
606
674
|
case ProjectTypeOptions.outlookAddin().id:
|
|
607
|
-
return localizeUtils_1.getLocalizedString("core.createProjectQuestion.projectType.outlookAddin.title");
|
|
608
675
|
case ProjectTypeOptions.officeAddin().id:
|
|
676
|
+
case ProjectTypeOptions.officeXMLAddin().id: {
|
|
677
|
+
switch (inputs[questionNames_1.QuestionNames.OfficeAddinHost]) {
|
|
678
|
+
case OfficeAddinHostOptions.outlook().id:
|
|
679
|
+
return localizeUtils_1.getLocalizedString("core.createProjectQuestion.projectType.outlookAddin.title");
|
|
680
|
+
case OfficeAddinHostOptions.word().id:
|
|
681
|
+
return localizeUtils_1.getLocalizedString("core.createProjectQuestion.officeXMLAddin.word.create.title");
|
|
682
|
+
case OfficeAddinHostOptions.excel().id:
|
|
683
|
+
return localizeUtils_1.getLocalizedString("core.createProjectQuestion.officeXMLAddin.excel.create.title");
|
|
684
|
+
case OfficeAddinHostOptions.powerpoint().id:
|
|
685
|
+
return localizeUtils_1.getLocalizedString("core.createProjectQuestion.officeXMLAddin.powerpoint.create.title");
|
|
686
|
+
}
|
|
609
687
|
return localizeUtils_1.getLocalizedString("core.createProjectQuestion.projectType.officeAddin.title");
|
|
688
|
+
}
|
|
610
689
|
case ProjectTypeOptions.copilotPlugin().id:
|
|
611
690
|
return localizeUtils_1.getLocalizedString("core.createProjectQuestion.projectType.copilotPlugin.title");
|
|
612
691
|
case ProjectTypeOptions.customCopilot().id:
|
|
@@ -640,7 +719,6 @@ function capabilityQuestion() {
|
|
|
640
719
|
}
|
|
641
720
|
// nodejs capabilities
|
|
642
721
|
const projectType = inputs[questionNames_1.QuestionNames.ProjectType];
|
|
643
|
-
const officeHost = inputs[questionNames_1.QuestionNames.OfficeAddinCapability];
|
|
644
722
|
if (projectType === ProjectTypeOptions.bot().id) {
|
|
645
723
|
return CapabilityOptions.bots(inputs);
|
|
646
724
|
}
|
|
@@ -650,18 +728,8 @@ function capabilityQuestion() {
|
|
|
650
728
|
else if (projectType === ProjectTypeOptions.me().id) {
|
|
651
729
|
return CapabilityOptions.mes();
|
|
652
730
|
}
|
|
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();
|
|
731
|
+
else if (ProjectTypeOptions.officeAddinAllIds().includes(projectType)) {
|
|
732
|
+
return CapabilityOptions.officeAddinDynamicCapabilities(projectType, inputs[questionNames_1.QuestionNames.OfficeAddinHost]);
|
|
665
733
|
}
|
|
666
734
|
else if (projectType === ProjectTypeOptions.copilotPlugin().id) {
|
|
667
735
|
return CapabilityOptions.copilotPlugins();
|
|
@@ -1042,51 +1110,15 @@ function SPFxImportFolderQuestion(hasDefaultFunc = false) {
|
|
|
1042
1110
|
};
|
|
1043
1111
|
}
|
|
1044
1112
|
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
1113
|
function officeAddinHostingQuestion() {
|
|
1055
|
-
|
|
1056
|
-
type: "singleSelect",
|
|
1114
|
+
return {
|
|
1057
1115
|
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,
|
|
1116
|
+
title: localizeUtils_1.getLocalizedString("core.createProjectQuestion.officeXMLAddin.create.title"),
|
|
1117
|
+
type: "singleSelect",
|
|
1118
|
+
staticOptions: OfficeAddinHostOptions.all(),
|
|
1067
1119
|
};
|
|
1068
|
-
return OfficeHostQuestion;
|
|
1069
1120
|
}
|
|
1070
1121
|
exports.officeAddinHostingQuestion = officeAddinHostingQuestion;
|
|
1071
|
-
function getAddinHostOptions(inputs) {
|
|
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
1122
|
function OfficeAddinFrameworkQuestion() {
|
|
1091
1123
|
return {
|
|
1092
1124
|
type: "singleSelect",
|
|
@@ -1103,63 +1135,72 @@ function OfficeAddinFrameworkQuestion() {
|
|
|
1103
1135
|
};
|
|
1104
1136
|
}
|
|
1105
1137
|
exports.OfficeAddinFrameworkQuestion = OfficeAddinFrameworkQuestion;
|
|
1106
|
-
|
|
1138
|
+
/**
|
|
1139
|
+
* when project-type=office-addin-type(office-addin-framework-type=default or react), use selected value;
|
|
1140
|
+
* when project-type=outlook-addin-type, no framework to select, office-addin-framework-type=default_old
|
|
1141
|
+
* when project-type=office-xml-addin-type, no framework to select, office-addin-framework-type=default_old
|
|
1142
|
+
*/
|
|
1143
|
+
function getOfficeAddinFramework(inputs) {
|
|
1144
|
+
const projectType = inputs[questionNames_1.QuestionNames.ProjectType];
|
|
1145
|
+
if (projectType === ProjectTypeOptions.officeAddin().id &&
|
|
1146
|
+
inputs[questionNames_1.QuestionNames.OfficeAddinFramework]) {
|
|
1147
|
+
return inputs[questionNames_1.QuestionNames.OfficeAddinFramework];
|
|
1148
|
+
}
|
|
1149
|
+
else if (projectType === ProjectTypeOptions.officeXMLAddin().id &&
|
|
1150
|
+
inputs[questionNames_1.QuestionNames.OfficeAddinHost] !== OfficeAddinHostOptions.outlook().id) {
|
|
1151
|
+
return "default";
|
|
1152
|
+
}
|
|
1153
|
+
else {
|
|
1154
|
+
return "default_old";
|
|
1155
|
+
}
|
|
1156
|
+
}
|
|
1157
|
+
exports.getOfficeAddinFramework = getOfficeAddinFramework;
|
|
1107
1158
|
function getLanguageOptions(inputs) {
|
|
1108
1159
|
const runtime = getRuntime(inputs);
|
|
1109
1160
|
// dotnet runtime only supports C#
|
|
1110
1161
|
if (runtime === RuntimeOptions.DotNet().id) {
|
|
1111
|
-
return [{ id:
|
|
1162
|
+
return [{ id: ProgrammingLanguage.CSharp, label: "C#" }];
|
|
1112
1163
|
}
|
|
1164
|
+
const capabilities = inputs[questionNames_1.QuestionNames.Capabilities];
|
|
1165
|
+
const host = inputs[questionNames_1.QuestionNames.OfficeAddinHost];
|
|
1113
1166
|
// office addin supports language defined in officeAddinJsonData
|
|
1114
1167
|
const projectType = inputs[questionNames_1.QuestionNames.ProjectType];
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
? projectConfig_1.getOfficeXMLAddinHostProjectLangOptions(officeHost, officeProject)
|
|
1129
|
-
: [{ id: "javascript", label: "JavaScript" }];
|
|
1130
|
-
}
|
|
1131
|
-
if (projectType === ProjectTypeOptions.officeAddin().id) {
|
|
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" }];
|
|
1168
|
+
if (ProjectTypeOptions.officeAddinAllIds().includes(projectType)) {
|
|
1169
|
+
if (capabilities.endsWith("-manifest")) {
|
|
1170
|
+
return [{ id: ProgrammingLanguage.JS, label: "JavaScript" }];
|
|
1171
|
+
}
|
|
1172
|
+
if (projectType === ProjectTypeOptions.outlookAddin().id ||
|
|
1173
|
+
(projectType === ProjectTypeOptions.officeXMLAddin().id &&
|
|
1174
|
+
host === OfficeAddinHostOptions.outlook().id)) {
|
|
1175
|
+
return [{ id: ProgrammingLanguage.TS, label: "TypeScript" }];
|
|
1176
|
+
}
|
|
1177
|
+
return [
|
|
1178
|
+
{ id: ProgrammingLanguage.TS, label: "TypeScript" },
|
|
1179
|
+
{ id: ProgrammingLanguage.JS, label: "JavaScript" },
|
|
1180
|
+
];
|
|
1144
1181
|
}
|
|
1145
|
-
const capabilities = inputs[questionNames_1.QuestionNames.Capabilities];
|
|
1146
1182
|
if (capabilities === CapabilityOptions.SPFxTab().id) {
|
|
1147
1183
|
// SPFx only supports typescript
|
|
1148
|
-
return [{ id:
|
|
1184
|
+
return [{ id: ProgrammingLanguage.TS, label: "TypeScript" }];
|
|
1149
1185
|
}
|
|
1150
1186
|
else if (constants_3.capabilitiesHavePythonOption.includes(capabilities)) {
|
|
1151
1187
|
// support python language
|
|
1152
1188
|
return [
|
|
1153
|
-
{ id:
|
|
1154
|
-
{ id:
|
|
1155
|
-
{
|
|
1189
|
+
{ id: ProgrammingLanguage.JS, label: "JavaScript" },
|
|
1190
|
+
{ id: ProgrammingLanguage.TS, label: "TypeScript" },
|
|
1191
|
+
{
|
|
1192
|
+
id: ProgrammingLanguage.PY,
|
|
1193
|
+
label: "Python",
|
|
1194
|
+
detail: "",
|
|
1195
|
+
description: localizeUtils_1.getLocalizedString("core.createProjectQuestion.option.description.preview"),
|
|
1196
|
+
},
|
|
1156
1197
|
];
|
|
1157
1198
|
}
|
|
1158
1199
|
else {
|
|
1159
1200
|
// other cases
|
|
1160
1201
|
return [
|
|
1161
|
-
{ id:
|
|
1162
|
-
{ id:
|
|
1202
|
+
{ id: ProgrammingLanguage.JS, label: "JavaScript" },
|
|
1203
|
+
{ id: ProgrammingLanguage.TS, label: "TypeScript" },
|
|
1163
1204
|
];
|
|
1164
1205
|
}
|
|
1165
1206
|
}
|
|
@@ -1193,14 +1234,14 @@ function programmingLanguageQuestion() {
|
|
|
1193
1234
|
if (runtime === RuntimeOptions.DotNet().id) {
|
|
1194
1235
|
return "";
|
|
1195
1236
|
}
|
|
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
1237
|
const capabilities = inputs[questionNames_1.QuestionNames.Capabilities];
|
|
1238
|
+
// // office addin
|
|
1239
|
+
// const projectType = inputs[QuestionNames.ProjectType];
|
|
1240
|
+
// if (projectType === ProjectTypeOptions.outlookAddin().id) {
|
|
1241
|
+
// const template = getTemplate(inputs);
|
|
1242
|
+
// const options = officeAddinJsonData.getSupportedScriptTypesNew(template);
|
|
1243
|
+
// return options[0] || "No Options";
|
|
1244
|
+
// }
|
|
1204
1245
|
// SPFx
|
|
1205
1246
|
if (capabilities === CapabilityOptions.SPFxTab().id) {
|
|
1206
1247
|
return localizeUtils_1.getLocalizedString("core.ProgrammingLanguageQuestion.placeholder.spfx");
|
|
@@ -1937,8 +1978,13 @@ function capabilitySubTree() {
|
|
|
1937
1978
|
],
|
|
1938
1979
|
},
|
|
1939
1980
|
{
|
|
1940
|
-
// office addin import sub-tree
|
|
1941
|
-
condition: {
|
|
1981
|
+
// office addin import sub-tree (capabilities=office-addin-import | outlook-addin-import)
|
|
1982
|
+
condition: {
|
|
1983
|
+
enum: [
|
|
1984
|
+
CapabilityOptions.outlookAddinImport().id,
|
|
1985
|
+
CapabilityOptions.officeAddinImport().id,
|
|
1986
|
+
],
|
|
1987
|
+
},
|
|
1942
1988
|
data: { type: "group", name: questionNames_1.QuestionNames.OfficeAddinImport },
|
|
1943
1989
|
children: [
|
|
1944
1990
|
{
|
|
@@ -1957,15 +2003,6 @@ function capabilitySubTree() {
|
|
|
1957
2003
|
},
|
|
1958
2004
|
],
|
|
1959
2005
|
},
|
|
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
2006
|
{
|
|
1970
2007
|
// Search ME sub-tree
|
|
1971
2008
|
condition: { equals: CapabilityOptions.m365SearchMe().id },
|
|
@@ -2045,7 +2082,9 @@ function capabilitySubTree() {
|
|
|
2045
2082
|
inputs[questionNames_1.QuestionNames.Capabilities] !== CapabilityOptions.copilotPluginApiSpec().id &&
|
|
2046
2083
|
inputs[questionNames_1.QuestionNames.Capabilities] !==
|
|
2047
2084
|
CapabilityOptions.copilotPluginOpenAIPlugin().id &&
|
|
2048
|
-
inputs[questionNames_1.QuestionNames.MeArchitectureType] !== MeArchitectureOptions.apiSpec().id
|
|
2085
|
+
inputs[questionNames_1.QuestionNames.MeArchitectureType] !== MeArchitectureOptions.apiSpec().id &&
|
|
2086
|
+
inputs[questionNames_1.QuestionNames.Capabilities] !== CapabilityOptions.officeAddinImport().id &&
|
|
2087
|
+
inputs[questionNames_1.QuestionNames.Capabilities] !== CapabilityOptions.outlookAddinImport().id);
|
|
2049
2088
|
},
|
|
2050
2089
|
},
|
|
2051
2090
|
{
|
|
@@ -2078,7 +2117,8 @@ function capabilitySubTree() {
|
|
|
2078
2117
|
{
|
|
2079
2118
|
// WXP addin framework
|
|
2080
2119
|
condition: (inputs) => {
|
|
2081
|
-
return inputs[questionNames_1.QuestionNames.ProjectType] === ProjectTypeOptions.officeAddin().id
|
|
2120
|
+
return (inputs[questionNames_1.QuestionNames.ProjectType] === ProjectTypeOptions.officeAddin().id &&
|
|
2121
|
+
inputs[questionNames_1.QuestionNames.Capabilities] !== CapabilityOptions.officeAddinImport().id);
|
|
2082
2122
|
},
|
|
2083
2123
|
data: OfficeAddinFrameworkQuestion(),
|
|
2084
2124
|
},
|
|
@@ -2109,19 +2149,8 @@ function createProjectQuestionNode() {
|
|
|
2109
2149
|
cliOptionDisabled: "self",
|
|
2110
2150
|
},
|
|
2111
2151
|
{
|
|
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
|
-
},
|
|
2152
|
+
condition: (inputs) => inputs[questionNames_1.QuestionNames.ProjectType] === ProjectTypeOptions.officeXMLAddin().id,
|
|
2153
|
+
data: officeAddinHostingQuestion(),
|
|
2125
2154
|
},
|
|
2126
2155
|
capabilitySubTree(),
|
|
2127
2156
|
{
|