Bump plugin deps

This commit is contained in:
Gregory Schier
2024-08-22 11:27:57 -07:00
parent d1871b19ee
commit 5ba11ca788
20 changed files with 66 additions and 55 deletions

View File

@@ -8,7 +8,7 @@
"name": "exporter-curl",
"version": "0.0.1",
"dependencies": {
"@yaakapp/api": "^0.1.9"
"@yaakapp/api": "^0.1.11"
},
"devDependencies": {
"@types/node": "^20.14.9",
@@ -701,9 +701,9 @@
}
},
"node_modules/@yaakapp/api": {
"version": "0.1.9",
"resolved": "https://registry.npmjs.org/@yaakapp/api/-/api-0.1.9.tgz",
"integrity": "sha512-5mgBoNplXUnNIUpLgGPCjcf6p/BcsU485cH3/MnIzcXIaMfFpZVVwHq5vf9cm+NDcr5hwYmPyIbwmBf9uVoV2Q==",
"version": "0.1.11",
"resolved": "https://registry.npmjs.org/@yaakapp/api/-/api-0.1.11.tgz",
"integrity": "sha512-dRZAXrQpftWygy9nJXiIYPzLA9om6reO/RiEacMe9RKqMjNG6FRF8cGmj7BcdyreizJOkH/DmcOpxn09kDD0XA==",
"dependencies": {
"@types/node": "^22.0.0"
}

View File

@@ -11,6 +11,6 @@
"vitest": "^1.4.0"
},
"dependencies": {
"@yaakapp/api": "^0.1.9"
"@yaakapp/api": "^0.1.11"
}
}

View File

@@ -8,7 +8,7 @@
"name": "filter-jsonpath",
"version": "0.0.1",
"dependencies": {
"@yaakapp/api": "^0.1.9",
"@yaakapp/api": "^0.1.11",
"jsonpath-plus": "^9.0.0"
},
"devDependencies": {
@@ -48,9 +48,9 @@
}
},
"node_modules/@yaakapp/api": {
"version": "0.1.9",
"resolved": "https://registry.npmjs.org/@yaakapp/api/-/api-0.1.9.tgz",
"integrity": "sha512-5mgBoNplXUnNIUpLgGPCjcf6p/BcsU485cH3/MnIzcXIaMfFpZVVwHq5vf9cm+NDcr5hwYmPyIbwmBf9uVoV2Q==",
"version": "0.1.11",
"resolved": "https://registry.npmjs.org/@yaakapp/api/-/api-0.1.11.tgz",
"integrity": "sha512-dRZAXrQpftWygy9nJXiIYPzLA9om6reO/RiEacMe9RKqMjNG6FRF8cGmj7BcdyreizJOkH/DmcOpxn09kDD0XA==",
"dependencies": {
"@types/node": "^22.0.0"
}

View File

@@ -7,7 +7,7 @@
},
"dependencies": {
"jsonpath-plus": "^9.0.0",
"@yaakapp/api": "^0.1.9"
"@yaakapp/api": "^0.1.11"
},
"devDependencies": {
"@types/node": "^20.14.9",

View File

@@ -9,7 +9,7 @@
"version": "0.0.1",
"dependencies": {
"@xmldom/xmldom": "^0.8.10",
"@yaakapp/api": "^0.1.9",
"@yaakapp/api": "^0.1.11",
"xpath": "^0.0.34"
},
"devDependencies": {
@@ -35,9 +35,9 @@
}
},
"node_modules/@yaakapp/api": {
"version": "0.1.9",
"resolved": "https://registry.npmjs.org/@yaakapp/api/-/api-0.1.9.tgz",
"integrity": "sha512-5mgBoNplXUnNIUpLgGPCjcf6p/BcsU485cH3/MnIzcXIaMfFpZVVwHq5vf9cm+NDcr5hwYmPyIbwmBf9uVoV2Q==",
"version": "0.1.11",
"resolved": "https://registry.npmjs.org/@yaakapp/api/-/api-0.1.11.tgz",
"integrity": "sha512-dRZAXrQpftWygy9nJXiIYPzLA9om6reO/RiEacMe9RKqMjNG6FRF8cGmj7BcdyreizJOkH/DmcOpxn09kDD0XA==",
"dependencies": {
"@types/node": "^22.0.0"
}

View File

@@ -6,7 +6,7 @@
"build": "yaakcli ./src/index.js"
},
"dependencies": {
"@yaakapp/api": "^0.1.9",
"@yaakapp/api": "^0.1.11",
"@xmldom/xmldom": "^0.8.10",
"xpath": "^0.0.34"
},

View File

@@ -8,7 +8,7 @@
"name": "importer-curl",
"version": "0.0.1",
"dependencies": {
"@yaakapp/api": "^0.1.9",
"@yaakapp/api": "^0.1.11",
"shell-quote": "^1.8.1"
},
"devDependencies": {
@@ -709,9 +709,9 @@
}
},
"node_modules/@yaakapp/api": {
"version": "0.1.9",
"resolved": "https://registry.npmjs.org/@yaakapp/api/-/api-0.1.9.tgz",
"integrity": "sha512-5mgBoNplXUnNIUpLgGPCjcf6p/BcsU485cH3/MnIzcXIaMfFpZVVwHq5vf9cm+NDcr5hwYmPyIbwmBf9uVoV2Q==",
"version": "0.1.11",
"resolved": "https://registry.npmjs.org/@yaakapp/api/-/api-0.1.11.tgz",
"integrity": "sha512-dRZAXrQpftWygy9nJXiIYPzLA9om6reO/RiEacMe9RKqMjNG6FRF8cGmj7BcdyreizJOkH/DmcOpxn09kDD0XA==",
"dependencies": {
"@types/node": "^22.0.0"
}

View File

@@ -6,7 +6,7 @@
"build": "yaakcli ./src/index.js"
},
"dependencies": {
"@yaakapp/api": "^0.1.9",
"@yaakapp/api": "^0.1.11",
"shell-quote": "^1.8.1"
},
"devDependencies": {

View File

@@ -8,7 +8,7 @@
"name": "importer-insomnia",
"version": "0.0.1",
"dependencies": {
"@yaakapp/api": "^0.1.9",
"@yaakapp/api": "^0.1.11",
"yaml": "^2.4.2"
},
"devDependencies": {
@@ -26,9 +26,9 @@
}
},
"node_modules/@yaakapp/api": {
"version": "0.1.9",
"resolved": "https://registry.npmjs.org/@yaakapp/api/-/api-0.1.9.tgz",
"integrity": "sha512-5mgBoNplXUnNIUpLgGPCjcf6p/BcsU485cH3/MnIzcXIaMfFpZVVwHq5vf9cm+NDcr5hwYmPyIbwmBf9uVoV2Q==",
"version": "0.1.11",
"resolved": "https://registry.npmjs.org/@yaakapp/api/-/api-0.1.11.tgz",
"integrity": "sha512-dRZAXrQpftWygy9nJXiIYPzLA9om6reO/RiEacMe9RKqMjNG6FRF8cGmj7BcdyreizJOkH/DmcOpxn09kDD0XA==",
"dependencies": {
"@types/node": "^22.0.0"
}

View File

@@ -6,7 +6,7 @@
"build": "yaakcli ./src/index.js"
},
"dependencies": {
"@yaakapp/api": "^0.1.9",
"@yaakapp/api": "^0.1.11",
"yaml": "^2.4.2"
},
"devDependencies": {

View File

@@ -8,7 +8,7 @@
"name": "importer-openapi",
"version": "0.0.1",
"dependencies": {
"@yaakapp/api": "^0.1.9",
"@yaakapp/api": "^0.1.11",
"openapi-to-postmanv2": "^4.23.1",
"yaml": "^2.4.2"
},
@@ -56,9 +56,9 @@
}
},
"node_modules/@yaakapp/api": {
"version": "0.1.9",
"resolved": "https://registry.npmjs.org/@yaakapp/api/-/api-0.1.9.tgz",
"integrity": "sha512-5mgBoNplXUnNIUpLgGPCjcf6p/BcsU485cH3/MnIzcXIaMfFpZVVwHq5vf9cm+NDcr5hwYmPyIbwmBf9uVoV2Q==",
"version": "0.1.11",
"resolved": "https://registry.npmjs.org/@yaakapp/api/-/api-0.1.11.tgz",
"integrity": "sha512-dRZAXrQpftWygy9nJXiIYPzLA9om6reO/RiEacMe9RKqMjNG6FRF8cGmj7BcdyreizJOkH/DmcOpxn09kDD0XA==",
"dependencies": {
"@types/node": "^22.0.0"
}

View File

@@ -6,7 +6,7 @@
"build": "yaakcli ./src/index.js"
},
"dependencies": {
"@yaakapp/api": "^0.1.9",
"@yaakapp/api": "^0.1.11",
"openapi-to-postmanv2": "^4.23.1",
"yaml": "^2.4.2"
},

View File

@@ -8,7 +8,7 @@
"name": "importer-postman",
"version": "0.0.1",
"dependencies": {
"@yaakapp/api": "^0.1.9"
"@yaakapp/api": "^0.1.11"
},
"devDependencies": {
"@types/node": "^20.14.9",
@@ -663,9 +663,9 @@
}
},
"node_modules/@yaakapp/api": {
"version": "0.1.9",
"resolved": "https://registry.npmjs.org/@yaakapp/api/-/api-0.1.9.tgz",
"integrity": "sha512-5mgBoNplXUnNIUpLgGPCjcf6p/BcsU485cH3/MnIzcXIaMfFpZVVwHq5vf9cm+NDcr5hwYmPyIbwmBf9uVoV2Q==",
"version": "0.1.11",
"resolved": "https://registry.npmjs.org/@yaakapp/api/-/api-0.1.11.tgz",
"integrity": "sha512-dRZAXrQpftWygy9nJXiIYPzLA9om6reO/RiEacMe9RKqMjNG6FRF8cGmj7BcdyreizJOkH/DmcOpxn09kDD0XA==",
"dependencies": {
"@types/node": "^22.0.0"
}

View File

@@ -7,7 +7,7 @@
"build": "yaakcli ./src/index.js"
},
"dependencies": {
"@yaakapp/api": "^0.1.9"
"@yaakapp/api": "^0.1.11"
},
"devDependencies": {
"@types/node": "^20.14.9",

View File

@@ -8,7 +8,7 @@
"name": "importer-yaak",
"version": "0.0.1",
"dependencies": {
"@yaakapp/api": "^0.1.9"
"@yaakapp/api": "^0.1.11"
},
"devDependencies": {
"@types/node": "^20.14.9",
@@ -394,9 +394,9 @@
}
},
"node_modules/@yaakapp/api": {
"version": "0.1.9",
"resolved": "https://registry.npmjs.org/@yaakapp/api/-/api-0.1.9.tgz",
"integrity": "sha512-5mgBoNplXUnNIUpLgGPCjcf6p/BcsU485cH3/MnIzcXIaMfFpZVVwHq5vf9cm+NDcr5hwYmPyIbwmBf9uVoV2Q==",
"version": "0.1.11",
"resolved": "https://registry.npmjs.org/@yaakapp/api/-/api-0.1.11.tgz",
"integrity": "sha512-dRZAXrQpftWygy9nJXiIYPzLA9om6reO/RiEacMe9RKqMjNG6FRF8cGmj7BcdyreizJOkH/DmcOpxn09kDD0XA==",
"dependencies": {
"@types/node": "^22.0.0"
}

View File

@@ -6,7 +6,7 @@
"build": "yaakcli ./src/index.js"
},
"dependencies": {
"@yaakapp/api": "^0.1.9"
"@yaakapp/api": "^0.1.11"
},
"devDependencies": {
"@types/node": "^20.14.9",

View File

@@ -9,7 +9,7 @@
"version": "0.0.1",
"dependencies": {
"@xmldom/xmldom": "^0.8.10",
"@yaakapp/api": "^0.1.9",
"@yaakapp/api": "^0.1.11",
"jsonpath-plus": "^9.0.0",
"xpath": "^0.0.34"
},
@@ -741,9 +741,9 @@
}
},
"node_modules/@yaakapp/api": {
"version": "0.1.9",
"resolved": "https://registry.npmjs.org/@yaakapp/api/-/api-0.1.9.tgz",
"integrity": "sha512-5mgBoNplXUnNIUpLgGPCjcf6p/BcsU485cH3/MnIzcXIaMfFpZVVwHq5vf9cm+NDcr5hwYmPyIbwmBf9uVoV2Q==",
"version": "0.1.11",
"resolved": "https://registry.npmjs.org/@yaakapp/api/-/api-0.1.11.tgz",
"integrity": "sha512-dRZAXrQpftWygy9nJXiIYPzLA9om6reO/RiEacMe9RKqMjNG6FRF8cGmj7BcdyreizJOkH/DmcOpxn09kDD0XA==",
"dependencies": {
"@types/node": "^22.0.0"
}

View File

@@ -6,7 +6,7 @@
"build": "yaakcli src/index.ts"
},
"dependencies": {
"@yaakapp/api": "^0.1.9",
"@yaakapp/api": "^0.1.11",
"jsonpath-plus": "^9.0.0",
"xpath": "^0.0.34",
"@xmldom/xmldom": "^0.8.10"

View File

@@ -1,5 +1,5 @@
import { DOMParser } from '@xmldom/xmldom';
import { CallTemplateFunctionArgs, Context, Plugin } from '@yaakapp/api';
import { CallTemplateFunctionArgs, Context, HttpResponse, Plugin } from '@yaakapp/api';
import { JSONPath } from 'jsonpath-plus';
import { readFileSync } from 'node:fs';
import xpath from 'xpath';
@@ -17,7 +17,7 @@ export const plugin: Plugin = {
type: 'text',
name: 'path',
label: 'JSONPath or XPath',
placeholder: '$.books[0].id or /books[0]/id'
placeholder: '$.books[0].id or /books[0]/id',
},
{
type: 'select',
@@ -48,9 +48,20 @@ export const plugin: Plugin = {
return null;
}
const response = (args.values.behavior === 'always' || responses[0] == null)
? await ctx.httpRequest.send({ httpRequest: renderedHttpRequest })
: responses[0];
let response: HttpResponse | null = responses[0] ?? null;
// Previews happen a ton, and we don't want to send too many times on "always," so treat
// it as "smart" during preview.
let behavior = args.values.behavior === 'always' && args.purpose === 'preview' ? 'smart' : args.values.behavior;
// Send if no responses and "smart," or "always"
if ((behavior === 'smart' && response == null) || behavior === 'always') {
response = await ctx.httpRequest.send({ httpRequest: renderedHttpRequest });
}
if (response == null) {
return null;
}
if (response.bodyPath == null) {
return null;
@@ -102,7 +113,7 @@ function filterXPath(body: string, path: string): string {
const items = xpath.select(path, doc, false);
if (Array.isArray(items)) {
return String(items[0] ?? '');
return items[0] != null ? String(items[0].firstChild ?? '') : '';
} else {
// Not sure what cases this happens in (?)
return String(items);

View File

@@ -1,5 +1,5 @@
const {readdirSync, readFileSync} = require('node:fs');
const {execSync} = require('node:child_process');
const { readdirSync, readFileSync } = require('node:fs');
const { execSync } = require('node:child_process');
const path = require('node:path');
async function main() {
@@ -13,8 +13,8 @@ async function main() {
const pkg = JSON.parse(readFileSync(path.join(pluginDir, 'package.json'), 'utf8'));
console.log('Building plugin', pkg.name, pluginDir);
execSync(`npm ci`, {cwd: pluginDir});
execSync(`npm run build`, {cwd: pluginDir});
execSync(`npm install`, { cwd: pluginDir });
execSync(`npm run build`, { cwd: pluginDir });
}
}