UNPKG

@microsoft/kiota

Version:

npm package exposing Kiota CLI functionality to TypeScript

28 lines 1.22 kB
import * as rpc from "vscode-jsonrpc/node"; import connectToKiota from "../connect"; /** * Retrieves the manifest details for a given API. * * @param {ManifestOptions} options - The options for retrieving the manifest details. * @param {string} options.manifestPath - The path to the manifest file. * @param {boolean} [options.clearCache] - Whether to clear the cache before retrieving the manifest details. * @param {string} [options.apiIdentifier] - The identifier of the API. * @returns {Promise<KiotaManifestResult | undefined>} A promise that resolves to the manifest details or undefined if not found. * @throws {Error} Throws an error if the request fails. */ export async function getManifestDetails({ manifestPath, clearCache, apiIdentifier }) { const result = await connectToKiota(async (connection) => { const request = new rpc.RequestType('GetManifestDetails'); return await connection.sendRequest(request, { manifestPath, apiIdentifier: apiIdentifier ?? '', clearCache: clearCache ?? false, }); }); if (result instanceof Error) { throw result; } return result; } ; //# sourceMappingURL=getManifestDetails.js.map