mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-21 17:09:09 +01:00
Add @yaakapp/api everywhere
This commit is contained in:
26
plugins/importer-openapi/package-lock.json
generated
26
plugins/importer-openapi/package-lock.json
generated
@@ -1,13 +1,14 @@
|
||||
{
|
||||
"name": "importer-postman",
|
||||
"name": "importer-openapi",
|
||||
"version": "0.0.1",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "importer-postman",
|
||||
"name": "importer-openapi",
|
||||
"version": "0.0.1",
|
||||
"dependencies": {
|
||||
"@yaakapp/api": "^0.1.6",
|
||||
"openapi-to-postmanv2": "^4.23.1",
|
||||
"yaml": "^2.4.2"
|
||||
},
|
||||
@@ -54,6 +55,27 @@
|
||||
"@types/node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@yaakapp/api": {
|
||||
"version": "0.1.6",
|
||||
"resolved": "https://registry.npmjs.org/@yaakapp/api/-/api-0.1.6.tgz",
|
||||
"integrity": "sha512-5lYXKcOVmLzVUrkfU4JOCbz+CBV5Dm/cALoZvfbelvZWOVu3sTrBxS9cbNVQQq2B6WwLInSevk7pMq58GqIj5Q==",
|
||||
"dependencies": {
|
||||
"@types/node": "^22.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@yaakapp/api/node_modules/@types/node": {
|
||||
"version": "22.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-22.3.0.tgz",
|
||||
"integrity": "sha512-nrWpWVaDZuaVc5X84xJ0vNrLvomM205oQyLsRt7OHNZbSHslcWsvgFR7O7hire2ZonjLrWBbedmotmIlJDVd6g==",
|
||||
"dependencies": {
|
||||
"undici-types": "~6.18.2"
|
||||
}
|
||||
},
|
||||
"node_modules/@yaakapp/api/node_modules/undici-types": {
|
||||
"version": "6.18.2",
|
||||
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.18.2.tgz",
|
||||
"integrity": "sha512-5ruQbENj95yDYJNS3TvcaxPMshV7aizdv/hWYjGIKoANWKjhWNBsr2YEuYZKodQulB1b8l7ILOuDQep3afowQQ=="
|
||||
},
|
||||
"node_modules/ajv": {
|
||||
"version": "8.11.0",
|
||||
"resolved": "https://registry.npmjs.org/ajv/-/ajv-8.11.0.tgz",
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
"build": "yaakcli ./src/index.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@yaakapp/api": "^0.1.6",
|
||||
"openapi-to-postmanv2": "^4.23.1",
|
||||
"yaml": "^2.4.2"
|
||||
},
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { YaakContext } from '@yaakapp/api';
|
||||
import { convert } from 'openapi-to-postmanv2';
|
||||
import { pluginHookImport as pluginHookImportPostman } from '../../importer-postman/src/index';
|
||||
import { Folder, HttpRequest, Workspace, Environment } from '../../../types/models';
|
||||
@@ -12,13 +13,13 @@ interface ExportResources {
|
||||
}
|
||||
|
||||
export async function pluginHookImport(
|
||||
ctx: any,
|
||||
ctx: YaakContext,
|
||||
contents: string,
|
||||
): Promise<{ resources: ExportResources } | undefined> {
|
||||
let postmanCollection;
|
||||
try {
|
||||
postmanCollection = await new Promise((resolve, reject) => {
|
||||
convert({ type: 'string', data: contents }, {}, (err, result) => {
|
||||
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