@microsoft/m365-spec-parser 0.1.1-alpha.b755b0fe8.0 → 0.1.1-alpha.c6bb96186.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.
@@ -796,7 +796,7 @@ class ManifestUpdater {
796
796
  static async updateManifestWithAiPlugin(manifestPath, outputSpecPath, apiPluginFilePath, spec) {
797
797
  const manifest = await fs.readJSON(manifestPath);
798
798
  const apiPluginRelativePath = ManifestUpdater.getRelativePath(manifestPath, apiPluginFilePath);
799
- manifest.apiPlugins = [
799
+ manifest.plugins = [
800
800
  {
801
801
  pluginFile: apiPluginRelativePath,
802
802
  },
@@ -1461,26 +1461,29 @@ class SpecParser {
1461
1461
  resultStr = JSON.stringify(newUnResolvedSpec, null, 2);
1462
1462
  }
1463
1463
  await fs.outputFile(outputSpecPath, resultStr);
1464
- for (const url in newSpec.paths) {
1465
- for (const method in newSpec.paths[url]) {
1466
- // paths object may contain description/summary, so we need to check if it is a operation object
1467
- if (method === ConstantString.PostMethod || method === ConstantString.GetMethod) {
1468
- const operation = newSpec.paths[url][method];
1469
- try {
1470
- const [card, jsonPath] = AdaptiveCardGenerator.generateAdaptiveCard(operation);
1471
- const fileName = path.join(adaptiveCardFolder, `${operation.operationId}.json`);
1472
- const wrappedCard = wrapAdaptiveCard(card, jsonPath);
1473
- await fs.outputJSON(fileName, wrappedCard, { spaces: 2 });
1474
- const dataFileName = path.join(adaptiveCardFolder, `${operation.operationId}.data.json`);
1475
- await fs.outputJSON(dataFileName, {}, { spaces: 2 });
1476
- }
1477
- catch (err) {
1478
- result.allSuccess = false;
1479
- result.warnings.push({
1480
- type: WarningType.GenerateCardFailed,
1481
- content: err.toString(),
1482
- data: operation.operationId,
1483
- });
1464
+ if (isMe === undefined || isMe === true) {
1465
+ // Only generate adaptive card for Messaging Extension
1466
+ for (const url in newSpec.paths) {
1467
+ for (const method in newSpec.paths[url]) {
1468
+ // paths object may contain description/summary, so we need to check if it is a operation object
1469
+ if (method === ConstantString.PostMethod || method === ConstantString.GetMethod) {
1470
+ const operation = newSpec.paths[url][method];
1471
+ try {
1472
+ const [card, jsonPath] = AdaptiveCardGenerator.generateAdaptiveCard(operation);
1473
+ const fileName = path.join(adaptiveCardFolder, `${operation.operationId}.json`);
1474
+ const wrappedCard = wrapAdaptiveCard(card, jsonPath);
1475
+ await fs.outputJSON(fileName, wrappedCard, { spaces: 2 });
1476
+ const dataFileName = path.join(adaptiveCardFolder, `${operation.operationId}.data.json`);
1477
+ await fs.outputJSON(dataFileName, {}, { spaces: 2 });
1478
+ }
1479
+ catch (err) {
1480
+ result.allSuccess = false;
1481
+ result.warnings.push({
1482
+ type: WarningType.GenerateCardFailed,
1483
+ content: err.toString(),
1484
+ data: operation.operationId,
1485
+ });
1486
+ }
1484
1487
  }
1485
1488
  }
1486
1489
  }