mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-05-01 21:24:13 +02:00
Add @yaakapp/api everywhere
This commit is contained in:
22
plugins/filter-jsonpath/package-lock.json
generated
22
plugins/filter-jsonpath/package-lock.json
generated
@@ -8,6 +8,7 @@
|
||||
"name": "filter-jsonpath",
|
||||
"version": "0.0.1",
|
||||
"dependencies": {
|
||||
"@yaakapp/api": "^0.1.6",
|
||||
"jsonpath": "^1.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
@@ -32,6 +33,27 @@
|
||||
"undici-types": "~5.26.4"
|
||||
}
|
||||
},
|
||||
"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/cross-env": {
|
||||
"version": "7.0.3",
|
||||
"resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz",
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
"build": "cross-env BUILD_PLATFORM=browser yaakcli src/index.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"jsonpath": "^1.1.1"
|
||||
"jsonpath": "^1.1.1",
|
||||
"@yaakapp/api": "^0.1.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jsonpath": "^0.2.4",
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { YaakContext } from '@yaakapp/api';
|
||||
import jp from 'jsonpath';
|
||||
|
||||
export function pluginHookResponseFilter(_ctx: any, args: { filter: string; body: string }) {
|
||||
export function pluginHookResponseFilter(_ctx: YaakContext, args: { filter: string; body: string }) {
|
||||
const parsed = JSON.parse(args.body);
|
||||
const filtered = jp.query(parsed, args.filter);
|
||||
return JSON.stringify(filtered, null, 2);
|
||||
|
||||
Reference in New Issue
Block a user