mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-05-10 09:50:08 +02:00
Merge main into proxy branch (formatting and docs)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
import { convertPostman } from '@yaak/importer-postman/src';
|
||||
import type { Context, PluginDefinition } from '@yaakapp/api';
|
||||
import type { ImportPluginResponse } from '@yaakapp/api/lib/plugins/ImporterPlugin';
|
||||
import { convert } from 'openapi-to-postmanv2';
|
||||
import { convertPostman } from "@yaak/importer-postman/src";
|
||||
import type { Context, PluginDefinition } from "@yaakapp/api";
|
||||
import type { ImportPluginResponse } from "@yaakapp/api/lib/plugins/ImporterPlugin";
|
||||
import { convert } from "openapi-to-postmanv2";
|
||||
|
||||
export const plugin: PluginDefinition = {
|
||||
importer: {
|
||||
name: 'OpenAPI',
|
||||
description: 'Import OpenAPI collections',
|
||||
name: "OpenAPI",
|
||||
description: "Import OpenAPI collections",
|
||||
onImport(_ctx: Context, args: { text: string }) {
|
||||
return convertOpenApi(args.text);
|
||||
},
|
||||
@@ -14,12 +14,12 @@ export const plugin: PluginDefinition = {
|
||||
};
|
||||
|
||||
export async function convertOpenApi(contents: string): Promise<ImportPluginResponse | undefined> {
|
||||
// biome-ignore lint/suspicious/noExplicitAny: none
|
||||
// oxlint-disable-next-line no-explicit-any
|
||||
let postmanCollection: any;
|
||||
try {
|
||||
postmanCollection = await new Promise((resolve, reject) => {
|
||||
// biome-ignore lint/suspicious/noExplicitAny: none
|
||||
convert({ type: 'string', data: contents }, {}, (err, result: any) => {
|
||||
// oxlint-disable-next-line no-explicit-any
|
||||
convert({ type: "string", data: contents }, {}, (err, result: any) => {
|
||||
if (err != null) reject(err);
|
||||
|
||||
if (Array.isArray(result.output) && result.output.length > 0) {
|
||||
|
||||
Reference in New Issue
Block a user