@microsoft/teamsfx-core 3.0.10-alpha.445672d19.0 → 3.0.10-alpha.4748befd3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/client/graphClient.d.ts +1 -0
- package/build/client/graphClient.d.ts.map +1 -1
- package/build/client/teamsDevPortalClient.d.ts +1 -0
- package/build/client/teamsDevPortalClient.d.ts.map +1 -1
- package/build/common/featureFlags.d.ts +5 -20
- package/build/common/featureFlags.d.ts.map +1 -1
- package/build/common/featureFlags.js +6 -21
- package/build/common/featureFlags.js.map +1 -1
- package/build/common/templates-config.json +1 -1
- package/build/component/coordinator/index.d.ts.map +1 -1
- package/build/component/coordinator/index.js +0 -11
- package/build/component/coordinator/index.js.map +1 -1
- package/build/component/deps-checker/internal/dotnetChecker.d.ts +5 -1
- package/build/component/deps-checker/internal/dotnetChecker.d.ts.map +1 -1
- package/build/component/deps-checker/internal/dotnetChecker.js +13 -1
- package/build/component/deps-checker/internal/dotnetChecker.js.map +1 -1
- package/build/component/driver/deploy/spfx/utility/spoClient.d.ts +1 -0
- package/build/component/driver/deploy/spfx/utility/spoClient.d.ts.map +1 -1
- package/build/component/driver/devTool/httpClient.d.ts +1 -0
- package/build/component/driver/devTool/httpClient.d.ts.map +1 -1
- package/build/component/driver/devTool/nodeInstaller.d.ts +1 -0
- package/build/component/driver/devTool/nodeInstaller.d.ts.map +1 -1
- package/build/component/driver/script/scriptDriver.d.ts +1 -0
- package/build/component/driver/script/scriptDriver.d.ts.map +1 -1
- package/build/component/driver/share/utils.d.ts.map +1 -1
- package/build/component/driver/share/utils.js +6 -0
- package/build/component/driver/share/utils.js.map +1 -1
- package/build/component/driver/teamsApp/constants.d.ts +1 -1
- package/build/component/driver/teamsApp/constants.d.ts.map +1 -1
- package/build/component/driver/teamsApp/constants.js +2 -2
- package/build/component/driver/teamsApp/constants.js.map +1 -1
- package/build/component/driver/teamsApp/copyAppPackageToSPFx.d.ts +1 -0
- package/build/component/driver/teamsApp/copyAppPackageToSPFx.d.ts.map +1 -1
- package/build/component/driver/teamsApp/interfaces/appdefinitions/appPackage.d.ts +1 -0
- package/build/component/driver/teamsApp/interfaces/appdefinitions/appPackage.d.ts.map +1 -1
- package/build/component/driver/teamsApp/utils/ManifestUtils.d.ts +1 -0
- package/build/component/driver/teamsApp/utils/ManifestUtils.d.ts.map +1 -1
- package/build/component/generator/declarativeAgent/generator.d.ts +5 -0
- package/build/component/generator/declarativeAgent/generator.d.ts.map +1 -1
- package/build/component/generator/declarativeAgent/generator.js +76 -36
- package/build/component/generator/declarativeAgent/generator.js.map +1 -1
- package/build/component/generator/generatorAction.d.ts +1 -0
- package/build/component/generator/generatorAction.d.ts.map +1 -1
- package/build/component/generator/openApiSpec/common.d.ts.map +1 -1
- package/build/component/generator/openApiSpec/common.js +11 -22
- package/build/component/generator/openApiSpec/common.js.map +1 -1
- package/build/component/generator/openApiSpec/kiota.d.ts +0 -6
- package/build/component/generator/openApiSpec/kiota.d.ts.map +1 -1
- package/build/component/generator/openApiSpec/kiota.js +2 -17
- package/build/component/generator/openApiSpec/kiota.js.map +1 -1
- package/build/component/generator/templates/templateInfo.d.ts +1 -1
- package/build/component/generator/templates/templateInfo.d.ts.map +1 -1
- package/build/component/generator/utils.d.ts +3 -2
- package/build/component/generator/utils.d.ts.map +1 -1
- package/build/component/generator/utils.js.map +1 -1
- package/build/component/m365/packageService.d.ts.map +1 -1
- package/build/component/m365/packageService.js +16 -20
- package/build/component/m365/packageService.js.map +1 -1
- package/build/component/middleware/envMW.d.ts.map +1 -1
- package/build/component/middleware/envMW.js +7 -0
- package/build/component/middleware/envMW.js.map +1 -1
- package/build/component/utils/envUtil.d.ts +1 -0
- package/build/component/utils/envUtil.d.ts.map +1 -1
- package/build/core/FxCore.d.ts.map +1 -1
- package/build/core/FxCore.js +29 -75
- package/build/core/FxCore.js.map +1 -1
- package/build/question/other.d.ts.map +1 -1
- package/build/question/other.js +0 -2
- package/build/question/other.js.map +1 -1
- package/build/question/questionNames.d.ts +0 -3
- package/build/question/questionNames.d.ts.map +1 -1
- package/build/question/questionNames.js +0 -3
- package/build/question/questionNames.js.map +1 -1
- package/build/question/scaffold/vsc/ProjectTypeOptions.d.ts +0 -1
- package/build/question/scaffold/vsc/ProjectTypeOptions.d.ts.map +1 -1
- package/build/question/scaffold/vsc/ProjectTypeOptions.js +1 -14
- package/build/question/scaffold/vsc/ProjectTypeOptions.js.map +1 -1
- package/build/question/scaffold/vsc/createRootNode.d.ts.map +1 -1
- package/build/question/scaffold/vsc/createRootNode.js +1 -5
- package/build/question/scaffold/vsc/createRootNode.js.map +1 -1
- package/build/question/scaffold/vsc/daProjectTypeNode.d.ts.map +1 -1
- package/build/question/scaffold/vsc/daProjectTypeNode.js +1 -2
- package/build/question/scaffold/vsc/daProjectTypeNode.js.map +1 -1
- package/build/question/scaffold/vsc/officeAddinProjectTypeNode.d.ts +0 -1
- package/build/question/scaffold/vsc/officeAddinProjectTypeNode.d.ts.map +1 -1
- package/build/question/scaffold/vsc/officeAddinProjectTypeNode.js +2 -51
- package/build/question/scaffold/vsc/officeAddinProjectTypeNode.js.map +1 -1
- package/build/question/scaffold/vsc/teamsProjectTypeNode.d.ts.map +1 -1
- package/build/question/scaffold/vsc/teamsProjectTypeNode.js +4 -15
- package/build/question/scaffold/vsc/teamsProjectTypeNode.js.map +1 -1
- package/package.json +5 -5
- package/resource/package.nls.cs.json +1 -0
- package/resource/package.nls.de.json +13 -12
- package/resource/package.nls.es.json +12 -11
- package/resource/package.nls.fr.json +1 -0
- package/resource/package.nls.it.json +1 -0
- package/resource/package.nls.ja.json +2 -1
- package/resource/package.nls.json +3 -4
- package/resource/package.nls.ko.json +12 -11
- package/resource/package.nls.pl.json +12 -11
- package/resource/package.nls.pt-BR.json +8 -7
- package/resource/package.nls.ru.json +3 -2
- package/resource/package.nls.tr.json +1 -0
- package/resource/package.nls.zh-Hans.json +1 -0
- package/resource/package.nls.zh-Hant.json +6 -5
- package/templates/fallback/common.zip +0 -0
- package/templates/fallback/csharp.zip +0 -0
- package/templates/fallback/js.zip +0 -0
- package/templates/fallback/python.zip +0 -0
- package/templates/fallback/ts.zip +0 -0
- package/templates/metadata.zip +0 -0
package/build/core/FxCore.js
CHANGED
|
@@ -18,7 +18,6 @@ const url_1 = require("url");
|
|
|
18
18
|
const teamsDevPortalClient_1 = require("../client/teamsDevPortalClient");
|
|
19
19
|
const constants_1 = require("../common/constants");
|
|
20
20
|
const daSpecParser_1 = require("../common/daSpecParser");
|
|
21
|
-
const featureFlags_1 = require("../common/featureFlags");
|
|
22
21
|
const globalVars_1 = require("../common/globalVars");
|
|
23
22
|
const localizeUtils_1 = require("../common/localizeUtils");
|
|
24
23
|
const projectSettingsHelper_1 = require("../common/projectSettingsHelper");
|
|
@@ -1056,7 +1055,7 @@ class FxCore {
|
|
|
1056
1055
|
.toString()
|
|
1057
1056
|
.split(/\r?\n/)
|
|
1058
1057
|
.forEach((line) => {
|
|
1059
|
-
const reg = /^([a-zA-Z_][a-zA-Z0-9_]*=)/g;
|
|
1058
|
+
const reg = /^([a-zA-Z_][a-zA-Z0-9_]*=)(.*)/g;
|
|
1060
1059
|
const match = reg.exec(line);
|
|
1061
1060
|
if (match) {
|
|
1062
1061
|
if (match[1].startsWith("TEAMSFX_ENV=")) {
|
|
@@ -1066,7 +1065,7 @@ class FxCore {
|
|
|
1066
1065
|
writeStream.write(`APP_NAME_SUFFIX=${targetEnvName}${os.EOL}`);
|
|
1067
1066
|
}
|
|
1068
1067
|
else if (match[1].startsWith("AGENT_SCOPE=")) {
|
|
1069
|
-
writeStream.write(`AGENT_SCOPE
|
|
1068
|
+
writeStream.write(`AGENT_SCOPE=${match[2]}${os.EOL}`);
|
|
1070
1069
|
}
|
|
1071
1070
|
else {
|
|
1072
1071
|
writeStream.write(`${match[1]}${os.EOL}`);
|
|
@@ -1349,24 +1348,10 @@ class FxCore {
|
|
|
1349
1348
|
if (!inputs.projectPath) {
|
|
1350
1349
|
throw new Error("projectPath is undefined"); // should never happen
|
|
1351
1350
|
}
|
|
1352
|
-
// Call Kiota to select the OpenAPI spec file
|
|
1353
|
-
if (inputs.platform === teamsfx_api_1.Platform.VSCode &&
|
|
1354
|
-
featureFlags_1.featureFlagManager.getBooleanValue(featureFlags_1.FeatureFlags.KiotaIntegration) &&
|
|
1355
|
-
inputs[constants_3.QuestionNames.ActionType] === constants_3.ActionStartOptions.apiSpec().id &&
|
|
1356
|
-
!!!inputs[constants_3.QuestionNames.ActionManifestPath]) {
|
|
1357
|
-
return (0, teamsfx_api_1.ok)({
|
|
1358
|
-
projectPath: inputs.projectPath,
|
|
1359
|
-
lastCommand: constants_2.KiotaLastCommands.addPlugin,
|
|
1360
|
-
manifestPath: inputs[constants_3.QuestionNames.ManifestPath],
|
|
1361
|
-
});
|
|
1362
|
-
}
|
|
1363
1351
|
const context = (0, globalVars_1.createContext)();
|
|
1364
1352
|
const teamsManifestPath = inputs[constants_3.QuestionNames.ManifestPath];
|
|
1365
1353
|
const appPackageFolder = path.dirname(teamsManifestPath);
|
|
1366
1354
|
const isGenerateFromApiSpec = inputs[constants_3.QuestionNames.ActionType] === constants_3.ActionStartOptions.apiSpec().id;
|
|
1367
|
-
const isKiotaIntegration = inputs.platform === teamsfx_api_1.Platform.VSCode &&
|
|
1368
|
-
featureFlags_1.featureFlagManager.getBooleanValue(featureFlags_1.FeatureFlags.KiotaIntegration) &&
|
|
1369
|
-
!!inputs[constants_3.QuestionNames.ActionManifestPath];
|
|
1370
1355
|
// validate the project is valid for adding plugin
|
|
1371
1356
|
const manifestRes = await ManifestUtils_1.manifestUtils._readAppManifest(teamsManifestPath);
|
|
1372
1357
|
if (manifestRes.isErr()) {
|
|
@@ -1393,15 +1378,9 @@ class FxCore {
|
|
|
1393
1378
|
// Will be used if generating from API spec
|
|
1394
1379
|
let specParser = undefined;
|
|
1395
1380
|
let authNameAndSchemes = [];
|
|
1396
|
-
if (isGenerateFromApiSpec
|
|
1381
|
+
if (isGenerateFromApiSpec) {
|
|
1397
1382
|
specParser = new m365_spec_parser_1.SpecParser(inputs[constants_3.QuestionNames.ApiSpecLocation].trim(), (0, helper_2.getParserOptions)(m365_spec_parser_1.ProjectType.Copilot, true));
|
|
1398
1383
|
const listResult = await (0, daSpecParser_1.listAPIInfo)(inputs[constants_3.QuestionNames.ApiSpecLocation].trim());
|
|
1399
|
-
if (inputs.platform === teamsfx_api_1.Platform.VSCode &&
|
|
1400
|
-
featureFlags_1.featureFlagManager.getBooleanValue(featureFlags_1.FeatureFlags.KiotaIntegration) &&
|
|
1401
|
-
inputs[constants_3.QuestionNames.ActionType] === constants_3.ActionStartOptions.apiSpec().id &&
|
|
1402
|
-
!!inputs[constants_3.QuestionNames.ActionManifestPath]) {
|
|
1403
|
-
inputs[constants_3.QuestionNames.ApiOperation] = listResult.APIs.filter((value) => value.isValid).map((value) => value.api);
|
|
1404
|
-
}
|
|
1405
1384
|
authNameAndSchemes = this.parseAuthNameAndScheme(listResult, inputs);
|
|
1406
1385
|
if (authNameAndSchemes.length > 0) {
|
|
1407
1386
|
const doesLocalYamlPathExists = await fs_extra_1.default.pathExists(path.join(inputs.projectPath, versionMetadata_1.MetadataV3.localConfigFile));
|
|
@@ -1428,64 +1407,39 @@ class FxCore {
|
|
|
1428
1407
|
actionId = `action_${suffix}`;
|
|
1429
1408
|
}
|
|
1430
1409
|
let destinationPluginManifestPath;
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
await
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1410
|
+
// generate files
|
|
1411
|
+
if (isGenerateFromApiSpec && specParser) {
|
|
1412
|
+
destinationPluginManifestPath =
|
|
1413
|
+
await CopilotGptManifestUtils_1.copilotGptManifestUtils.getDefaultNextAvailablePluginManifestPath(appPackageFolder, undefined);
|
|
1414
|
+
const destinationApiSpecPath = await PluginManifestUtils_1.pluginManifestUtils.getDefaultNextAvailableApiSpecPath(inputs[constants_3.QuestionNames.ApiSpecLocation].trim(), path.join(appPackageFolder, teamsfx_api_1.DefaultApiSpecFolderName));
|
|
1415
|
+
const generateRes = await (0, helper_2.generateFromApiSpec)(specParser, teamsManifestPath, inputs, context, teamsfx_api_1.Stage.addPlugin, m365_spec_parser_1.ProjectType.Copilot, {
|
|
1416
|
+
destinationApiSpecFilePath: destinationApiSpecPath,
|
|
1417
|
+
pluginManifestFilePath: destinationPluginManifestPath,
|
|
1418
|
+
}, inputs[constants_3.QuestionNames.ApiSpecLocation].trim());
|
|
1419
|
+
if (generateRes.isErr()) {
|
|
1420
|
+
return (0, teamsfx_api_1.err)(generateRes.error);
|
|
1421
|
+
}
|
|
1422
|
+
const warnings = generateRes.value.warnings;
|
|
1423
|
+
if (warnings && warnings.length > 0) {
|
|
1424
|
+
const warnSummary = await (0, helper_2.generateScaffoldingSummary)(warnings, manifestRes.value, path.relative(inputs.projectPath, destinationApiSpecPath), path.relative(inputs.projectPath, destinationPluginManifestPath), inputs.projectPath);
|
|
1425
|
+
context.logProvider.info(warnSummary + "\n");
|
|
1426
|
+
}
|
|
1447
1427
|
const addActionRes = await CopilotGptManifestUtils_1.copilotGptManifestUtils.addAction(declarativeCopilotManifestPath, actionId, (0, utils_3.normalizePath)(path.relative(appPackageFolder, destinationPluginManifestPath), true));
|
|
1448
1428
|
if (addActionRes.isErr()) {
|
|
1449
1429
|
return (0, teamsfx_api_1.err)(addActionRes.error);
|
|
1450
1430
|
}
|
|
1451
|
-
|
|
1452
|
-
|
|
1431
|
+
for (const authNameAndScheme of authNameAndSchemes) {
|
|
1432
|
+
await this.updateAuthActionInYaml(authNameAndScheme.authName, authNameAndScheme.authScheme, inputs.projectPath, destinationApiSpecPath, destinationPluginManifestPath);
|
|
1433
|
+
}
|
|
1453
1434
|
}
|
|
1454
1435
|
else {
|
|
1455
|
-
|
|
1456
|
-
if (
|
|
1457
|
-
|
|
1458
|
-
await CopilotGptManifestUtils_1.copilotGptManifestUtils.getDefaultNextAvailablePluginManifestPath(appPackageFolder, undefined);
|
|
1459
|
-
const destinationApiSpecPath = await PluginManifestUtils_1.pluginManifestUtils.getDefaultNextAvailableApiSpecPath(inputs[constants_3.QuestionNames.ApiSpecLocation].trim(), path.join(appPackageFolder, teamsfx_api_1.DefaultApiSpecFolderName));
|
|
1460
|
-
const generateRes = await (0, helper_2.generateFromApiSpec)(specParser, teamsManifestPath, inputs, context, teamsfx_api_1.Stage.addPlugin, m365_spec_parser_1.ProjectType.Copilot, {
|
|
1461
|
-
destinationApiSpecFilePath: destinationApiSpecPath,
|
|
1462
|
-
pluginManifestFilePath: destinationPluginManifestPath,
|
|
1463
|
-
}, inputs[constants_3.QuestionNames.ApiSpecLocation].trim());
|
|
1464
|
-
if (generateRes.isErr()) {
|
|
1465
|
-
return (0, teamsfx_api_1.err)(generateRes.error);
|
|
1466
|
-
}
|
|
1467
|
-
const warnings = generateRes.value.warnings;
|
|
1468
|
-
if (warnings && warnings.length > 0) {
|
|
1469
|
-
const warnSummary = await (0, helper_2.generateScaffoldingSummary)(warnings, manifestRes.value, path.relative(inputs.projectPath, destinationApiSpecPath), path.relative(inputs.projectPath, destinationPluginManifestPath), inputs.projectPath);
|
|
1470
|
-
context.logProvider.info(warnSummary + "\n");
|
|
1471
|
-
}
|
|
1472
|
-
const addActionRes = await CopilotGptManifestUtils_1.copilotGptManifestUtils.addAction(declarativeCopilotManifestPath, actionId, (0, utils_3.normalizePath)(path.relative(appPackageFolder, destinationPluginManifestPath), true));
|
|
1473
|
-
if (addActionRes.isErr()) {
|
|
1474
|
-
return (0, teamsfx_api_1.err)(addActionRes.error);
|
|
1475
|
-
}
|
|
1476
|
-
for (const authNameAndScheme of authNameAndSchemes) {
|
|
1477
|
-
await this.updateAuthActionInYaml(authNameAndScheme.authName, authNameAndScheme.authScheme, inputs.projectPath, destinationApiSpecPath, destinationPluginManifestPath);
|
|
1478
|
-
}
|
|
1479
|
-
}
|
|
1480
|
-
else {
|
|
1481
|
-
const addPluginRes = await (0, helper_1.addExistingPlugin)(declarativeCopilotManifestPath, inputs[constants_3.QuestionNames.PluginManifestFilePath].trim(), inputs[constants_3.QuestionNames.PluginOpenApiSpecFilePath].trim(), actionId, context, teamsfx_api_1.Stage.addPlugin);
|
|
1482
|
-
if (addPluginRes.isErr()) {
|
|
1483
|
-
return (0, teamsfx_api_1.err)(addPluginRes.error);
|
|
1484
|
-
}
|
|
1485
|
-
destinationPluginManifestPath = addPluginRes.value.destinationPluginManifestPath;
|
|
1486
|
-
const warningMessage = (0, common_1.outputScaffoldingWarningMessage)(addPluginRes.value.warnings);
|
|
1487
|
-
context.logProvider.info(warningMessage);
|
|
1436
|
+
const addPluginRes = await (0, helper_1.addExistingPlugin)(declarativeCopilotManifestPath, inputs[constants_3.QuestionNames.PluginManifestFilePath].trim(), inputs[constants_3.QuestionNames.PluginOpenApiSpecFilePath].trim(), actionId, context, teamsfx_api_1.Stage.addPlugin);
|
|
1437
|
+
if (addPluginRes.isErr()) {
|
|
1438
|
+
return (0, teamsfx_api_1.err)(addPluginRes.error);
|
|
1488
1439
|
}
|
|
1440
|
+
destinationPluginManifestPath = addPluginRes.value.destinationPluginManifestPath;
|
|
1441
|
+
const warningMessage = (0, common_1.outputScaffoldingWarningMessage)(addPluginRes.value.warnings);
|
|
1442
|
+
context.logProvider.info(warningMessage);
|
|
1489
1443
|
}
|
|
1490
1444
|
if (inputs.platform === teamsfx_api_1.Platform.VSCode) {
|
|
1491
1445
|
const successMessage = (0, localizeUtils_1.getLocalizedString)("core.addPlugin.success.vsc", actionId);
|