@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
|
@@ -2,32 +2,37 @@
|
|
|
2
2
|
// Copyright (c) Microsoft Corporation.
|
|
3
3
|
// Licensed under the MIT license.
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.OfficeAddinGenerator = void 0;
|
|
5
|
+
exports.getHost = exports.OfficeAddinGenerator = void 0;
|
|
6
6
|
const tslib_1 = require("tslib");
|
|
7
7
|
/**
|
|
8
8
|
* @author yefuwang@microsoft.com
|
|
9
9
|
*/
|
|
10
|
+
const lib_1 = require("@feathersjs/hooks/lib");
|
|
10
11
|
const teamsfx_api_1 = require("@microsoft/teamsfx-api");
|
|
11
|
-
const path_1 = require("path");
|
|
12
|
-
const helperMethods_1 = require("./helperMethods");
|
|
13
|
-
const office_addin_manifest_1 = require("office-addin-manifest");
|
|
14
|
-
const projectsJsonData_1 = tslib_1.__importDefault(require("./config/projectsJsonData"));
|
|
15
12
|
const childProcess = tslib_1.__importStar(require("child_process"));
|
|
16
|
-
const
|
|
17
|
-
const lodash_1 = tslib_1.__importDefault(require("lodash"));
|
|
18
|
-
const lib_1 = require("@feathersjs/hooks/lib");
|
|
19
|
-
const actionExecutionMW_1 = require("../../middleware/actionExecutionMW");
|
|
20
|
-
const generator_1 = require("../generator");
|
|
13
|
+
const office_addin_manifest_1 = require("office-addin-manifest");
|
|
21
14
|
const office_addin_project_1 = require("office-addin-project");
|
|
22
|
-
const
|
|
23
|
-
const
|
|
15
|
+
const path_1 = require("path");
|
|
16
|
+
const util_1 = require("util");
|
|
24
17
|
const localizeUtils_1 = require("../../../common/localizeUtils");
|
|
25
18
|
const error_1 = require("../../../error");
|
|
26
|
-
const
|
|
19
|
+
const create_1 = require("../../../question/create");
|
|
20
|
+
const questionNames_1 = require("../../../question/questionNames");
|
|
21
|
+
const actionExecutionMW_1 = require("../../middleware/actionExecutionMW");
|
|
22
|
+
const generator_1 = require("../generator");
|
|
23
|
+
const projectConfig_1 = require("../officeXMLAddin/projectConfig");
|
|
24
|
+
const helperMethods_1 = require("./helperMethods");
|
|
25
|
+
const lodash_1 = require("lodash");
|
|
26
|
+
const utils_1 = require("../utils");
|
|
27
27
|
const componentName = "office-addin";
|
|
28
28
|
const telemetryEvent = "generate";
|
|
29
29
|
const templateName = "office-addin";
|
|
30
30
|
const templateNameForWXPO = "office-json-addin";
|
|
31
|
+
/**
|
|
32
|
+
* case 1: project-type=office-xml-addin-type AND addin-host=outlook
|
|
33
|
+
* case 2: project-type=office-addin-type (addin-host=undefined)
|
|
34
|
+
* case 3: project-type=outlook-addin-type (addin-host=undefined)
|
|
35
|
+
*/
|
|
31
36
|
class OfficeAddinGenerator {
|
|
32
37
|
static async generate(context, inputs, destinationPath) {
|
|
33
38
|
const result = await OfficeAddinGenerator.doScaffolding(context, inputs, destinationPath);
|
|
@@ -35,8 +40,11 @@ class OfficeAddinGenerator {
|
|
|
35
40
|
return teamsfx_api_1.err(result.error);
|
|
36
41
|
}
|
|
37
42
|
// If lang is undefined, it means the project is created from a folder.
|
|
38
|
-
const lang = inputs[questionNames_1.QuestionNames.ProgrammingLanguage];
|
|
39
|
-
const langKey =
|
|
43
|
+
const lang = lodash_1.toLower(inputs[questionNames_1.QuestionNames.ProgrammingLanguage]);
|
|
44
|
+
const langKey = inputs[questionNames_1.QuestionNames.Capabilities] === create_1.CapabilityOptions.outlookAddinImport().id ||
|
|
45
|
+
inputs[questionNames_1.QuestionNames.Capabilities] === create_1.CapabilityOptions.officeAddinImport().id
|
|
46
|
+
? "ts"
|
|
47
|
+
: utils_1.convertToLangKey(lang);
|
|
40
48
|
const templateRes = await generator_1.Generator.generateTemplate(context, destinationPath, inputs[questionNames_1.QuestionNames.ProjectType] === create_1.ProjectTypeOptions.officeAddin().id
|
|
41
49
|
? templateNameForWXPO
|
|
42
50
|
: templateName, langKey);
|
|
@@ -48,43 +56,51 @@ class OfficeAddinGenerator {
|
|
|
48
56
|
return util_1.promisify(childProcess.exec)(cmdLine);
|
|
49
57
|
}
|
|
50
58
|
static async doScaffolding(context, inputs, destinationPath) {
|
|
51
|
-
const template = create_1.getTemplate(inputs);
|
|
52
59
|
const name = inputs[questionNames_1.QuestionNames.AppName];
|
|
53
60
|
const addinRoot = destinationPath;
|
|
54
61
|
const fromFolder = inputs[questionNames_1.QuestionNames.OfficeAddinFolder];
|
|
55
|
-
const language = inputs[questionNames_1.QuestionNames.ProgrammingLanguage];
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
62
|
+
const language = lodash_1.toLower(inputs[questionNames_1.QuestionNames.ProgrammingLanguage]);
|
|
63
|
+
const projectType = inputs[questionNames_1.QuestionNames.ProjectType];
|
|
64
|
+
const capability = inputs[questionNames_1.QuestionNames.Capabilities];
|
|
65
|
+
const inputHost = inputs[questionNames_1.QuestionNames.OfficeAddinHost];
|
|
66
|
+
let host = inputHost;
|
|
67
|
+
if (projectType === create_1.ProjectTypeOptions.outlookAddin().id ||
|
|
68
|
+
(projectType === create_1.ProjectTypeOptions.officeXMLAddin().id &&
|
|
69
|
+
inputHost === create_1.OfficeAddinHostOptions.outlook().id)) {
|
|
70
|
+
host = "outlook";
|
|
71
|
+
}
|
|
72
|
+
else if (projectType === create_1.ProjectTypeOptions.officeAddin().id) {
|
|
73
|
+
if (capability === "json-taskpane") {
|
|
74
|
+
host = "wxpo"; // wxpo - support word, excel, powerpoint, outlook
|
|
75
|
+
}
|
|
76
|
+
else if (capability === create_1.CapabilityOptions.officeContentAddin().id) {
|
|
77
|
+
host = "xp"; // content add-in support excel, powerpoint
|
|
78
|
+
}
|
|
79
|
+
}
|
|
61
80
|
const workingDir = process.cwd();
|
|
62
|
-
const
|
|
81
|
+
const importProgressStr = projectType === create_1.ProjectTypeOptions.officeAddin().id
|
|
82
|
+
? localizeUtils_1.getLocalizedString("core.generator.officeAddin.importOfficeProject.title")
|
|
83
|
+
: localizeUtils_1.getLocalizedString("core.generator.officeAddin.importProject.title");
|
|
84
|
+
const importProgress = context.userInteraction.createProgressBar(importProgressStr, 3);
|
|
63
85
|
process.chdir(addinRoot);
|
|
64
86
|
try {
|
|
65
87
|
if (!fromFolder) {
|
|
66
88
|
// from template
|
|
67
|
-
const
|
|
68
|
-
const
|
|
69
|
-
const
|
|
70
|
-
const projectLink = isOfficeAddin
|
|
71
|
-
? jsonData.getProjectDownloadLinkNew(template, language, framework)
|
|
72
|
-
: jsonData.getProjectDownloadLink(template, language);
|
|
89
|
+
const framework = create_1.getOfficeAddinFramework(inputs);
|
|
90
|
+
const templateConfig = projectConfig_1.getOfficeAddinTemplateConfig(projectType, inputs[questionNames_1.QuestionNames.OfficeAddinHost]);
|
|
91
|
+
const projectLink = templateConfig[capability].framework[framework][language];
|
|
73
92
|
// Copy project template files from project repository
|
|
74
93
|
if (projectLink) {
|
|
75
94
|
await helperMethods_1.HelperMethods.downloadProjectTemplateZipFile(addinRoot, projectLink);
|
|
95
|
+
let cmdLine = ""; // Call 'convert-to-single-host' npm script in generated project, passing in host parameter
|
|
76
96
|
if (inputs[questionNames_1.QuestionNames.ProjectType] === create_1.ProjectTypeOptions.officeAddin().id) {
|
|
77
|
-
|
|
78
|
-
const cmdLine = `npm run convert-to-single-host --if-present -- ${lodash_1.default.toLower("wxpo" // support word, excel, powerpoint, outlook
|
|
79
|
-
)} ${"json"}`;
|
|
80
|
-
await OfficeAddinGenerator.childProcessExec(cmdLine);
|
|
97
|
+
cmdLine = `npm run convert-to-single-host --if-present -- ${host} json`;
|
|
81
98
|
}
|
|
82
99
|
else {
|
|
83
|
-
|
|
84
|
-
const cmdLine = `npm run convert-to-single-host --if-present -- ${lodash_1.default.toLower(host)}`;
|
|
85
|
-
await OfficeAddinGenerator.childProcessExec(cmdLine);
|
|
100
|
+
cmdLine = `npm run convert-to-single-host --if-present -- ${host}`;
|
|
86
101
|
}
|
|
87
|
-
|
|
102
|
+
await OfficeAddinGenerator.childProcessExec(cmdLine);
|
|
103
|
+
const manifestPath = templateConfig[capability].manifestPath;
|
|
88
104
|
// modify manifest guid and DisplayName
|
|
89
105
|
await office_addin_manifest_1.OfficeAddinManifest.modifyManifestFile(`${path_1.join(addinRoot, manifestPath)}`, "random", `${name}`);
|
|
90
106
|
await helperMethods_1.HelperMethods.moveManifestLocation(addinRoot, manifestPath);
|
|
@@ -138,19 +154,24 @@ async function getHost(addinManifestPath) {
|
|
|
138
154
|
const addinManifest = await teamsfx_api_1.ManifestUtil.loadFromPath(addinManifestPath);
|
|
139
155
|
let host = "Outlook";
|
|
140
156
|
switch ((_c = (_b = (_a = addinManifest.extensions) === null || _a === void 0 ? void 0 : _a[0].requirements) === null || _b === void 0 ? void 0 : _b.scopes) === null || _c === void 0 ? void 0 : _c[0]) {
|
|
141
|
-
|
|
142
|
-
|
|
157
|
+
case "document":
|
|
158
|
+
host = "Word";
|
|
159
|
+
break;
|
|
143
160
|
case "mail":
|
|
144
161
|
host = "Outlook";
|
|
162
|
+
break;
|
|
145
163
|
// case "notebook":
|
|
146
164
|
// host = "OneNote";
|
|
147
|
-
|
|
148
|
-
|
|
165
|
+
case "presentation":
|
|
166
|
+
host = "PowerPoint";
|
|
167
|
+
break;
|
|
149
168
|
// case "project":
|
|
150
169
|
// host = "Project";
|
|
151
|
-
|
|
152
|
-
|
|
170
|
+
case "workbook":
|
|
171
|
+
host = "Excel";
|
|
172
|
+
break;
|
|
153
173
|
}
|
|
154
174
|
return host;
|
|
155
175
|
}
|
|
176
|
+
exports.getHost = getHost;
|
|
156
177
|
//# sourceMappingURL=generator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../src/component/generator/officeAddin/generator.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;;AAElC;;GAEG;AAEH,wDASgC;AAChC
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../src/component/generator/officeAddin/generator.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;;AAElC;;GAEG;AAEH,+CAA8C;AAC9C,wDASgC;AAChC,oEAA8C;AAC9C,iEAA4D;AAC5D,+DAAsD;AACtD,+BAA4B;AAC5B,+BAAiC;AACjC,iEAAmE;AACnE,0CAA+C;AAC/C,qDAKkC;AAClC,mEAAgE;AAChE,0EAAuE;AACvE,4CAAyC;AACzC,mEAA+E;AAC/E,mDAAgD;AAChD,mCAAiC;AACjC,oCAA4C;AAE5C,MAAM,aAAa,GAAG,cAAc,CAAC;AACrC,MAAM,cAAc,GAAG,UAAU,CAAC;AAClC,MAAM,YAAY,GAAG,cAAc,CAAC;AACpC,MAAM,mBAAmB,GAAG,mBAAmB,CAAC;AAEhD;;;;GAIG;AACH,MAAa,oBAAoB;IAS/B,MAAM,CAAC,KAAK,CAAC,QAAQ,CACnB,OAAgB,EAChB,MAAc,EACd,eAAuB;QAEvB,MAAM,MAAM,GAAG,MAAM,oBAAoB,CAAC,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,eAAe,CAAC,CAAC;QAC1F,IAAI,MAAM,CAAC,KAAK,EAA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AC;;;;0CA6BD;AArCH,oDA4IC;AAKM,KAAK,UAAU,OAAO,CAAC,iBAAyB;;IACrD,4BAA4B;IAC5B,MAAM,aAAa,GAAgC,MAAM,0BAAY,CAAC,YAAY,CAChF,iBAAiB,CAClB,CAAC;IACF,IAAI,IAAI,GAAe,SAAS,CAAC;IACjC,QAAQ,MAAA,MAAA,MAAA,aAAa,CAAC,UAAU,0CAAG,CAAC,EAAE,YAAY,0CAAE,MAAM,0CAAG,CAAC,CAAC,EAAE;QAC/D,KAAK,UAAU;YACb,IAAI,GAAG,MAAM,CAAC;YACd,MAAM;QACR,KAAK,MAAM;YACT,IAAI,GAAG,SAAS,CAAC;YACjB,MAAM;QACR,mBAAmB;QACnB,sBAAsB;QACtB,KAAK,cAAc;YACjB,IAAI,GAAG,YAAY,CAAC;YACpB,MAAM;QACR,kBAAkB;QAClB,sBAAsB;QACtB,KAAK,UAAU;YACb,IAAI,GAAG,OAAO,CAAC;YACf,MAAM;KACT;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAzBD,0BAyBC"}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import { FxError, Inputs, Result
|
|
1
|
+
import { Context, FxError, Inputs, Result } from "@microsoft/teamsfx-api";
|
|
2
|
+
import { ActionContext } from "../../middleware/actionExecutionMW";
|
|
3
|
+
/**
|
|
4
|
+
* project-type=office-xml-addin-type addin-host!==outlook
|
|
5
|
+
*/
|
|
2
6
|
export declare class OfficeXMLAddinGenerator {
|
|
3
|
-
static generate(context: Context, inputs: Inputs, destinationPath: string): Promise<Result<undefined, FxError>>;
|
|
7
|
+
static generate(context: Context, inputs: Inputs, destinationPath: string, actionContext?: ActionContext): Promise<Result<undefined, FxError>>;
|
|
4
8
|
static childProcessExec(cmdLine: string): Promise<{
|
|
5
9
|
stdout: string;
|
|
6
10
|
stderr: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../../../src/component/generator/officeXMLAddin/generator.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAW,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../../../src/component/generator/officeXMLAddin/generator.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAW,MAAM,wBAAwB,CAAC;AASnF,OAAO,EAAqB,aAAa,EAAE,MAAM,oCAAoC,CAAC;AAkBtF;;GAEG;AACH,qBAAa,uBAAuB;WASrB,QAAQ,CACnB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,EACd,eAAe,EAAE,MAAM,EACvB,aAAa,CAAC,EAAE,aAAa,GAC5B,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;WA0FlB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;QAC7D,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;CAGH"}
|
|
@@ -10,55 +10,72 @@ const tslib_1 = require("tslib");
|
|
|
10
10
|
const lib_1 = require("@feathersjs/hooks/lib");
|
|
11
11
|
const teamsfx_api_1 = require("@microsoft/teamsfx-api");
|
|
12
12
|
const childProcess = tslib_1.__importStar(require("child_process"));
|
|
13
|
-
const lodash_1 = tslib_1.
|
|
13
|
+
const lodash_1 = tslib_1.__importStar(require("lodash"));
|
|
14
14
|
const office_addin_manifest_1 = require("office-addin-manifest");
|
|
15
15
|
const path_1 = require("path");
|
|
16
16
|
const util_1 = require("util");
|
|
17
|
-
const
|
|
18
|
-
const helperMethods_1 = require("../officeAddin/helperMethods");
|
|
19
|
-
const actionExecutionMW_1 = require("../../middleware/actionExecutionMW");
|
|
17
|
+
const localizeUtils_1 = require("../../../common/localizeUtils");
|
|
20
18
|
const error_1 = require("../../../error");
|
|
21
|
-
const create_1 = require("../../../question/create");
|
|
22
19
|
const questionNames_1 = require("../../../question/questionNames");
|
|
20
|
+
const actionExecutionMW_1 = require("../../middleware/actionExecutionMW");
|
|
21
|
+
const generator_1 = require("../generator");
|
|
22
|
+
const helperMethods_1 = require("../officeAddin/helperMethods");
|
|
23
23
|
const projectConfig_1 = require("./projectConfig");
|
|
24
|
-
const
|
|
24
|
+
const utils_1 = require("../utils");
|
|
25
25
|
const COMPONENT_NAME = "office-xml-addin";
|
|
26
26
|
const TELEMETRY_EVENT = "generate";
|
|
27
27
|
const TEMPLATE_BASE = "office-xml-addin";
|
|
28
|
+
const TEMPLATE_COMMON_NAME = "office-xml-addin-common";
|
|
29
|
+
const TEMPLATE_COMMON_LANG = "common";
|
|
30
|
+
/**
|
|
31
|
+
* project-type=office-xml-addin-type addin-host!==outlook
|
|
32
|
+
*/
|
|
28
33
|
class OfficeXMLAddinGenerator {
|
|
29
|
-
static async generate(context, inputs, destinationPath) {
|
|
30
|
-
const host = inputs[questionNames_1.QuestionNames.
|
|
31
|
-
const
|
|
32
|
-
const lang = inputs[questionNames_1.QuestionNames.ProgrammingLanguage]
|
|
34
|
+
static async generate(context, inputs, destinationPath, actionContext) {
|
|
35
|
+
const host = inputs[questionNames_1.QuestionNames.OfficeAddinHost];
|
|
36
|
+
const capability = inputs[questionNames_1.QuestionNames.Capabilities];
|
|
37
|
+
const lang = lodash_1.default.toLower(inputs[questionNames_1.QuestionNames.ProgrammingLanguage]);
|
|
38
|
+
const langKey = utils_1.convertToLangKey(lang);
|
|
33
39
|
const appName = inputs[questionNames_1.QuestionNames.AppName];
|
|
34
|
-
const
|
|
35
|
-
const
|
|
40
|
+
const projectType = inputs[questionNames_1.QuestionNames.ProjectType];
|
|
41
|
+
const templateConfig = projectConfig_1.getOfficeAddinTemplateConfig(projectType, host);
|
|
42
|
+
const templateName = templateConfig[capability].localTemplate;
|
|
43
|
+
const projectLink = templateConfig[capability].framework["default"][lang];
|
|
36
44
|
const workingDir = process.cwd();
|
|
37
45
|
const progressBar = context.userInteraction.createProgressBar(localizeUtils_1.getLocalizedString("core.createProjectQuestion.officeXMLAddin.bar.title"), 1);
|
|
46
|
+
lodash_1.merge(actionContext === null || actionContext === void 0 ? void 0 : actionContext.telemetryProps, {
|
|
47
|
+
["office-xml-addin-host" /* host */]: host,
|
|
48
|
+
["office-xml-addin-project" /* project */]: capability,
|
|
49
|
+
["office-xml-addin-lang" /* lang */]: lang,
|
|
50
|
+
});
|
|
38
51
|
try {
|
|
39
52
|
process.chdir(destinationPath);
|
|
40
53
|
await progressBar.start();
|
|
41
54
|
await progressBar.next(localizeUtils_1.getLocalizedString("core.createProjectQuestion.officeXMLAddin.bar.detail"));
|
|
42
|
-
if (!!
|
|
55
|
+
if (!!projectLink) {
|
|
43
56
|
// [Condition]: Project have remote repo (not manifest-only proj)
|
|
44
57
|
// -> Step: Download the project from GitHub
|
|
45
|
-
await helperMethods_1.HelperMethods.downloadProjectTemplateZipFile(destinationPath,
|
|
58
|
+
await helperMethods_1.HelperMethods.downloadProjectTemplateZipFile(destinationPath, projectLink);
|
|
46
59
|
// -> Step: Convert to single Host
|
|
47
60
|
await OfficeXMLAddinGenerator.childProcessExec(`npm run convert-to-single-host --if-present -- ${lodash_1.default.toLower(host)}`);
|
|
48
61
|
}
|
|
49
62
|
else {
|
|
50
63
|
// [Condition]: Manifest Only
|
|
51
64
|
// -> Step: Copy proj files for manifest-only project
|
|
52
|
-
const getManifestOnlyProjectTemplateRes = await generator_1.Generator.generateTemplate(context, destinationPath, `${TEMPLATE_BASE}-manifest-only`,
|
|
65
|
+
const getManifestOnlyProjectTemplateRes = await generator_1.Generator.generateTemplate(context, destinationPath, `${TEMPLATE_BASE}-manifest-only`, langKey);
|
|
53
66
|
if (getManifestOnlyProjectTemplateRes.isErr())
|
|
54
|
-
|
|
67
|
+
throw teamsfx_api_1.err(getManifestOnlyProjectTemplateRes.error);
|
|
55
68
|
}
|
|
56
69
|
// -> Common Step: Copy the README (or with manifest for manifest-only proj)
|
|
57
|
-
const getReadmeTemplateRes = await generator_1.Generator.generateTemplate(context, destinationPath, `${TEMPLATE_BASE}-${templateName}`,
|
|
70
|
+
const getReadmeTemplateRes = await generator_1.Generator.generateTemplate(context, destinationPath, `${TEMPLATE_BASE}-${templateName}`, langKey);
|
|
58
71
|
if (getReadmeTemplateRes.isErr())
|
|
59
|
-
|
|
72
|
+
throw teamsfx_api_1.err(getReadmeTemplateRes.error);
|
|
60
73
|
// -> Common Step: Modify the Manifest
|
|
61
74
|
await office_addin_manifest_1.OfficeAddinManifest.modifyManifestFile(`${path_1.join(destinationPath, "manifest.xml")}`, "random", `${appName}`);
|
|
75
|
+
// -> Common Step: Generate OfficeXMLAddin specific `teamsapp.yml`
|
|
76
|
+
const generateOfficeYMLRes = await generator_1.Generator.generateTemplate(context, destinationPath, TEMPLATE_COMMON_NAME, TEMPLATE_COMMON_LANG);
|
|
77
|
+
if (generateOfficeYMLRes.isErr())
|
|
78
|
+
throw teamsfx_api_1.err(generateOfficeYMLRes.error);
|
|
62
79
|
process.chdir(workingDir);
|
|
63
80
|
await progressBar.end(true, true);
|
|
64
81
|
return teamsfx_api_1.ok(undefined);
|
|
@@ -83,7 +100,7 @@ tslib_1.__decorate([
|
|
|
83
100
|
}),
|
|
84
101
|
]),
|
|
85
102
|
tslib_1.__metadata("design:type", Function),
|
|
86
|
-
tslib_1.__metadata("design:paramtypes", [Object, Object, String]),
|
|
103
|
+
tslib_1.__metadata("design:paramtypes", [Object, Object, String, Object]),
|
|
87
104
|
tslib_1.__metadata("design:returntype", Promise)
|
|
88
105
|
], OfficeXMLAddinGenerator, "generate", null);
|
|
89
106
|
exports.OfficeXMLAddinGenerator = OfficeXMLAddinGenerator;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../src/component/generator/officeXMLAddin/generator.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;;AAElC;;GAEG;AAEH,+CAA8C;AAC9C,wDAAmF;AACnF,oEAA8C;AAC9C,
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../src/component/generator/officeXMLAddin/generator.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;;AAElC;;GAEG;AAEH,+CAA8C;AAC9C,wDAAmF;AACnF,oEAA8C;AAC9C,yDAAkC;AAClC,iEAA4D;AAC5D,+BAA4B;AAC5B,+BAAiC;AACjC,iEAAmE;AACnE,0CAA+C;AAC/C,mEAAgE;AAChE,0EAAsF;AACtF,4CAAyC;AACzC,gEAA6D;AAC7D,mDAA+D;AAC/D,oCAA4C;AAE5C,MAAM,cAAc,GAAG,kBAAkB,CAAC;AAC1C,MAAM,eAAe,GAAG,UAAU,CAAC;AACnC,MAAM,aAAa,GAAG,kBAAkB,CAAC;AACzC,MAAM,oBAAoB,GAAG,yBAAyB,CAAC;AACvD,MAAM,oBAAoB,GAAG,QAAQ,CAAC;AAQtC;;GAEG;AACH,MAAa,uBAAuB;IASlC,MAAM,CAAC,KAAK,CAAC,QAAQ,CACnB,OAAgB,EAChB,MAAc,EACd,eAAuB,EACvB,aAA6B;QAE7B,MAAM,IAAI,GAAG,MAAM,CAAC,6BAAa,CAAC,eAAe,CAAW,CAAC;QAC7D,MAAM,UAAU,GAAG,MAAM,CAAC,6BAAa,CAAC,YAAY,CAAC,CAAC;QACtD,MAAM,IAAI,GAAG,gBAAC,CAAC,OAAO,CAAC,MAAM,CAAC,6BAAa,CAAC,mBAAmB,CAAC,CAEhD,CAAC;QACjB,MAAM,OAAO,GAAG,wBAAgB,CAAC,IAAI,CAAC,CAAC;QACvC,MAAM,OAAO,GAAG,MAAM,CAAC,6BAAa,CAAC,OAAO,CAAW,CAAC;QACxD,MAAM,WAAW,GAAG,MAAM,CAAC,6BAAa,CAAC,WAAW,CAAC,CAAC;QACtD,MAAM,cAAc,GAAG,4CAA4B,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;QACvE,MAAM,YAAY,GAA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kB,EAAE,eAAe;YACnC,WAAW,EAAE,cAAc;SAC5B,CAAC;KACH,CAAC;;;;6CA8FD;AAtGH,0DA8GC"}
|
|
@@ -1,36 +1,24 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* @param host Office host
|
|
4
|
-
* @returns the detail proj options[] of the host
|
|
2
|
+
* @author zyun@microsoft.com
|
|
5
3
|
*/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
*/
|
|
27
|
-
export declare function getOfficeXMLAddinHostProjectTemplateName(host: string, proj: string): string;
|
|
28
|
-
/**
|
|
29
|
-
* Get the Repo Info of the proj
|
|
30
|
-
* @param host wxp
|
|
31
|
-
* @param proj proj name
|
|
32
|
-
* @param lang ts or js
|
|
33
|
-
* @returns Repo Info
|
|
34
|
-
*/
|
|
35
|
-
export declare function getOfficeXMLAddinHostProjectRepoInfo(host: string, proj: string, lang: "ts" | "js"): string;
|
|
4
|
+
interface IOfficeAddinHostConfig {
|
|
5
|
+
[property: string]: {
|
|
6
|
+
title: string;
|
|
7
|
+
detail: string;
|
|
8
|
+
localTemplate: string;
|
|
9
|
+
manifestPath?: string;
|
|
10
|
+
framework: {
|
|
11
|
+
[property: string]: {
|
|
12
|
+
typescript?: string;
|
|
13
|
+
javascript?: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
interface IOfficeAddinProjectConfig {
|
|
19
|
+
[property: string]: IOfficeAddinHostConfig;
|
|
20
|
+
}
|
|
21
|
+
export declare const OfficeAddinProjectConfig: IOfficeAddinProjectConfig;
|
|
22
|
+
export declare function getOfficeAddinTemplateConfig(projectType: string, addinHost?: string): IOfficeAddinHostConfig;
|
|
23
|
+
export {};
|
|
36
24
|
//# sourceMappingURL=projectConfig.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projectConfig.d.ts","sourceRoot":"","sources":["../../../../src/component/generator/officeXMLAddin/projectConfig.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"projectConfig.d.ts","sourceRoot":"","sources":["../../../../src/component/generator/officeXMLAddin/projectConfig.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,UAAU,sBAAsB;IAC9B,CAAC,QAAQ,EAAE,MAAM,GAAG;QAClB,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;QACf,aAAa,EAAE,MAAM,CAAC;QACtB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,SAAS,EAAE;YACT,CAAC,QAAQ,EAAE,MAAM,GAAG;gBAClB,UAAU,CAAC,EAAE,MAAM,CAAC;gBACpB,UAAU,CAAC,EAAE,MAAM,CAAC;aACrB,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAED,UAAU,yBAAyB;IACjC,CAAC,QAAQ,EAAE,MAAM,GAAG,sBAAsB,CAAC;CAC5C;AAsCD,eAAO,MAAM,wBAAwB,EAAE,yBA0HtC,CAAC;AAEF,wBAAgB,4BAA4B,CAC1C,WAAW,EAAE,MAAM,EACnB,SAAS,CAAC,EAAE,MAAM,GACjB,sBAAsB,CASxB"}
|