@autorest/openapi-to-typespec
Version:
Autorest plugin to scaffold a Typespec definition from an OpenAPI document
17 lines • 777 B
JavaScript
;
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
Object.defineProperty(exports, "__esModule", { value: true });
exports.emitLegacy = void 0;
const fs_1 = require("fs");
const path_1 = require("path");
const autorest_session_1 = require("../autorest-session");
const format_1 = require("../utils/format");
async function emitLegacy(filePath) {
const session = (0, autorest_session_1.getSession)();
const path = (0, path_1.join)(__dirname, "..", "assets", "legacy.tsp");
const legacyContent = (0, fs_1.readFileSync)(path, "utf-8");
session.writeFile({ filename: filePath, content: await (0, format_1.formatTypespecFile)(legacyContent, filePath) });
}
exports.emitLegacy = emitLegacy;
//# sourceMappingURL=emit-legacy.js.map