mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-18 06:49:50 +02:00
Update plugins
This commit is contained in:
@@ -1,6 +1,16 @@
|
||||
import { Context, Environment } from '@yaakapp/api';
|
||||
import { Environment, PluginDefinition } from '@yaakapp/api';
|
||||
|
||||
export function pluginHookImport(_ctx: Context, contents: string) {
|
||||
export const plugin: PluginDefinition = {
|
||||
importer: {
|
||||
name: 'Yaak',
|
||||
description: 'Yaak official format',
|
||||
onImport(_ctx, args) {
|
||||
return migrateImport(args.text) as any;
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export function migrateImport(contents: string) {
|
||||
let parsed;
|
||||
try {
|
||||
parsed = JSON.parse(contents);
|
||||
|
||||
Reference in New Issue
Block a user