@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.
- package/dist/index.esm2017.mjs +24 -21
- package/dist/index.esm2017.mjs.map +1 -1
- package/dist/index.node.cjs.js +24 -21
- package/dist/index.node.cjs.js.map +1 -1
- package/package.json +3 -3
package/dist/index.esm2017.mjs
CHANGED
|
@@ -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.
|
|
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
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
const
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
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
|
}
|