mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-17 23:14:03 +01:00
Template response plugin
This commit is contained in:
19
plugins/filter-xpath/package-lock.json
generated
19
plugins/filter-xpath/package-lock.json
generated
@@ -8,17 +8,20 @@
|
||||
"name": "filter-xpath",
|
||||
"version": "0.0.1",
|
||||
"dependencies": {
|
||||
"@types/node": "^20.14.9",
|
||||
"@xmldom/xmldom": "^0.8.10",
|
||||
"@yaakapp/api": "^0.1.6",
|
||||
"typescript": "^5.5.2",
|
||||
"@yaakapp/api": "^0.1.9",
|
||||
"xpath": "^0.0.34"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^20.14.9",
|
||||
"typescript": "^5.5.2"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/node": {
|
||||
"version": "20.14.9",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.9.tgz",
|
||||
"integrity": "sha512-06OCtnTXtWOZBJlRApleWndH4JsRVs1pDCc8dLSQp+7PpUpX3ePdHyeNSFTeSe7FtKyQkrlPvHwJOW3SLd8Oyg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"undici-types": "~5.26.4"
|
||||
}
|
||||
@@ -32,9 +35,9 @@
|
||||
}
|
||||
},
|
||||
"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==",
|
||||
"version": "0.1.9",
|
||||
"resolved": "https://registry.npmjs.org/@yaakapp/api/-/api-0.1.9.tgz",
|
||||
"integrity": "sha512-5mgBoNplXUnNIUpLgGPCjcf6p/BcsU485cH3/MnIzcXIaMfFpZVVwHq5vf9cm+NDcr5hwYmPyIbwmBf9uVoV2Q==",
|
||||
"dependencies": {
|
||||
"@types/node": "^22.0.0"
|
||||
}
|
||||
@@ -56,6 +59,7 @@
|
||||
"version": "5.5.2",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.2.tgz",
|
||||
"integrity": "sha512-NcRtPEOsPFFWjobJEtfihkLCZCXZt/os3zf8nTxjVH3RvTSxjrCamJpbExGvYOF+tFHc3pA65qpdwPbzjohhew==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"tsc": "bin/tsc",
|
||||
"tsserver": "bin/tsserver"
|
||||
@@ -67,7 +71,8 @@
|
||||
"node_modules/undici-types": {
|
||||
"version": "5.26.5",
|
||||
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz",
|
||||
"integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA=="
|
||||
"integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/xpath": {
|
||||
"version": "0.0.34",
|
||||
|
||||
@@ -1,14 +1,17 @@
|
||||
{
|
||||
"name": "filter-xpath",
|
||||
"private": true,
|
||||
"version": "0.0.1",
|
||||
"scripts": {
|
||||
"build": "yaakcli ./src/index.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@yaakapp/api": "^0.1.6",
|
||||
"@types/node": "^20.14.9",
|
||||
"@yaakapp/api": "^0.1.9",
|
||||
"@xmldom/xmldom": "^0.8.10",
|
||||
"typescript": "^5.5.2",
|
||||
"xpath": "^0.0.34"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^20.14.9",
|
||||
"typescript": "^5.5.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { DOMParser } from '@xmldom/xmldom';
|
||||
import { YaakContext } from '@yaakapp/api';
|
||||
import { Context } from '@yaakapp/api';
|
||||
import xpath from 'xpath';
|
||||
|
||||
export function pluginHookResponseFilter(
|
||||
_ctx: YaakContext,
|
||||
_ctx: Context,
|
||||
{ filter, body }: { filter: string; body: string },
|
||||
) {
|
||||
const doc = new DOMParser().parseFromString(body, 'text/xml');
|
||||
|
||||
Reference in New Issue
Block a user