mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-12-04 22:06:24 +01:00
Add Bruno imports and a file-tree importer API (#706)
This commit is contained in:
1 parent
46464cfacf
commit
aa10c44a45
109 files changed
+4684
-879
No files matched your search
@@ -1,4 +1,4 @@
|
||||
import type { Context, PluginDefinition } from "@yaakapp/api";
|
||||
import type { Context, ImportSource, PluginDefinition } from "@yaakapp/api";
|
||||
import YAML from "yaml";
|
||||
import { deleteUndefinedAttrs, isJSObject } from "./common";
|
||||
import { convertInsomniaV4 } from "./v4";
|
||||
@@ -8,8 +8,9 @@ export const plugin: PluginDefinition = {
|
||||
importer: {
|
||||
name: "Insomnia",
|
||||
description: "Import Insomnia workspaces",
|
||||
async onImport(_ctx: Context, args: { text: string }) {
|
||||
return convertInsomnia(args.text);
|
||||
async onImportSource(_ctx: Context, { source }: { source: ImportSource }) {
|
||||
if (source.type !== "text") return null;
|
||||
return convertInsomnia(source.text);
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user