@microsoft/m365-spec-parser 0.2.7-alpha.84d482fe0.0 → 0.2.7-alpha.860281dbb.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.
@@ -3,7 +3,7 @@ import converter from 'swagger2openapi';
3
3
  import jsyaml from 'js-yaml';
4
4
  import fs from 'fs-extra';
5
5
  import path from 'path';
6
- import { ManifestUtil } from '@microsoft/app-manifest';
6
+ import { AppManifestUtils } from '@microsoft/app-manifest';
7
7
  import { createHash } from 'crypto';
8
8
 
9
9
  // Copyright (c) Microsoft Corporation.
@@ -1726,10 +1726,14 @@ function inferProperties(card) {
1726
1726
 
1727
1727
  // Copyright (c) Microsoft Corporation.
1728
1728
  class ManifestUpdater {
1729
+ static async useCopilotExtensionsInSchema(manifest) {
1730
+ const schema = await AppManifestUtils.fetchSchema(manifest.$schema);
1731
+ return !!schema.properties.copilotExtensions;
1732
+ }
1729
1733
  static async updateManifestWithAiPlugin(manifestPath, outputSpecPath, apiPluginFilePath, spec, options, authMap, existingPluginManifestInfo) {
1730
1734
  const manifest = await fs.readJSON(manifestPath);
1731
1735
  const apiPluginRelativePath = ManifestUpdater.getRelativePath(manifestPath, apiPluginFilePath);
1732
- const useCopilotExtensionsInSchema = await ManifestUtil.useCopilotExtensionsInSchema(manifest);
1736
+ const useCopilotExtensionsInSchema = await this.useCopilotExtensionsInSchema(manifest);
1733
1737
  if (manifest.copilotExtensions || useCopilotExtensionsInSchema) {
1734
1738
  manifest.copilotExtensions = manifest.copilotExtensions || {};
1735
1739
  if (!options.isGptPlugin) {