Add @yaakapp/api everywhere

This commit is contained in:
Gregory Schier
2024-08-15 06:17:33 -07:00
parent bb3f948596
commit 54efb6ae4e
25 changed files with 258 additions and 1984 deletions

View File

@@ -7,10 +7,13 @@
"": {
"name": "importer-postman",
"version": "0.0.1",
"dependencies": {
"@yaakapp/api": "^0.1.6"
},
"devDependencies": {
"@types/node": "^20.14.9",
"esbuild": "^0.21.5",
"typescript": "^5.5.2",
"vite": "^5.3.2",
"vitest": "^1.4.0"
}
},
@@ -659,6 +662,27 @@
"url": "https://opencollective.com/vitest"
}
},
"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/acorn": {
"version": "8.11.3",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz",

View File

@@ -5,6 +5,9 @@
"scripts": {
"build": "yaakcli ./src/index.js"
},
"dependencies": {
"@yaakapp/api": "^0.1.6"
},
"devDependencies": {
"@types/node": "^20.14.9",
"esbuild": "^0.21.5",

View File

@@ -1,5 +1,4 @@
import { root } from 'postcss';
import { Environment, Folder, HttpHeader, HttpRequest, Model, Workspace } from '../../../types/models';
import { Environment, Folder, HttpRequest, HttpRequestHeader, Model, Workspace, YaakContext } from '@yaakapp/api';
const POSTMAN_2_1_0_SCHEMA = 'https://schema.getpostman.com/json/collection/v2.1.0/collection.json';
const POSTMAN_2_0_0_SCHEMA = 'https://schema.getpostman.com/json/collection/v2.0.0/collection.json';
@@ -15,7 +14,7 @@ interface ExportResources {
}
export function pluginHookImport(
_ctx: any,
_ctx: YaakContext,
contents: string,
): { resources: ExportResources } | undefined {
const root = parseJSONToRecord(contents);
@@ -68,7 +67,7 @@ export function pluginHookImport(
const requestAuthPath = importAuth(r.auth);
const authPatch = requestAuthPath.authenticationType == null ? globalAuth : requestAuthPath;
const headers: HttpHeader[] = toArray(r.header).map((h) => {
const headers: HttpRequestHeader[] = toArray(r.header).map((h) => {
return {
name: h.key,
value: h.value,