mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-05-02 05:24:18 +02:00
Fix bug
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
"version": "0.0.1",
|
||||
"dependencies": {
|
||||
"@xmldom/xmldom": "^0.8.10",
|
||||
"@yaakapp/api": "^0.1.12",
|
||||
"@yaakapp/api": "^0.1.13",
|
||||
"jsonpath-plus": "^9.0.0",
|
||||
"xpath": "^0.0.34"
|
||||
},
|
||||
@@ -741,9 +741,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@yaakapp/api": {
|
||||
"version": "0.1.12",
|
||||
"resolved": "https://registry.npmjs.org/@yaakapp/api/-/api-0.1.12.tgz",
|
||||
"integrity": "sha512-qA+2BBZz1LGTi0wsOmlwaw6xJbE3elPIUMt/BkiRT+DqQC5spZtISsyoPXjtsM0xZc2orjoRJd0LesXH7xkD0g==",
|
||||
"version": "0.1.13",
|
||||
"resolved": "https://registry.npmjs.org/@yaakapp/api/-/api-0.1.13.tgz",
|
||||
"integrity": "sha512-FSYPHZV0mP967w63VXi9zYP81hPo3vjSW3/UElJLuF/8ig6WmG4p1q2oYos4Ik267Z3qSQAGN5dPMfuk3DAnBA==",
|
||||
"dependencies": {
|
||||
"@types/node": "^22.0.0"
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"build": "yaakcli src/index.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@yaakapp/api": "^0.1.12",
|
||||
"@yaakapp/api": "^0.1.13",
|
||||
"jsonpath-plus": "^9.0.0",
|
||||
"xpath": "^0.0.34",
|
||||
"@xmldom/xmldom": "^0.8.10"
|
||||
|
||||
@@ -27,7 +27,6 @@ export const plugin: Plugin = {
|
||||
options: [
|
||||
{ name: 'When no responses', value: 'smart' },
|
||||
{ name: 'Always', value: 'always' },
|
||||
{ name: 'Never', value: 'never' },
|
||||
],
|
||||
},
|
||||
],
|
||||
@@ -40,7 +39,7 @@ export const plugin: Plugin = {
|
||||
if (httpRequest == null) {
|
||||
return null;
|
||||
}
|
||||
const renderedHttpRequest = await ctx.httpRequest.render({ httpRequest });
|
||||
const renderedHttpRequest = await ctx.httpRequest.render({ httpRequest, purpose: args.purpose });
|
||||
|
||||
const responses = await ctx.httpResponse.find({ requestId: httpRequest.id, limit: 1 });
|
||||
|
||||
@@ -52,7 +51,9 @@ export const plugin: Plugin = {
|
||||
|
||||
// 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;
|
||||
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') {
|
||||
|
||||
Reference in New Issue
Block a user