New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

insomnia-plugin-response

Package Overview
Dependencies
Maintainers
1
Versions
103
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

insomnia-plugin-response - npm Package Compare versions

Comparing version 2.1.4 to 2.1.6

5

__tests__/index.test.js

@@ -536,2 +536,5 @@ const tag = require('..').templateTags[0];

context: {
getEnvironmentId() {
return null;
},
getExtraInfo(key) {

@@ -579,3 +582,3 @@ if (_extraInfo) {

response: {
getLatestForRequestId(requestId) {
getLatestForRequestId(requestId, environmentId) {
return responses.find(r => r.parentId === requestId) || null;

@@ -582,0 +585,0 @@ },

@@ -5,2 +5,6 @@ const jq = require('jsonpath');

function isFilterableField(field) {
return field !== 'raw' && field !== 'url';
}
module.exports.templateTags = [

@@ -31,2 +35,7 @@ {

},
{
displayName: 'Request URL',
description: 'Url of initiating request',
value: 'url',
},
],

@@ -42,3 +51,3 @@ },

encoding: 'base64',
hide: args => args[0].value === 'raw',
hide: args => !isFilterableField(args[0].value),
displayName: args => {

@@ -83,3 +92,3 @@ switch (args[0].value) {

if (!['body', 'header', 'raw'].includes(field)) {
if (!['body', 'header', 'raw', 'url'].includes(field)) {
throw new Error(`Invalid response field ${field}`);

@@ -97,3 +106,4 @@ }

let response = await context.util.models.response.getLatestForRequestId(id);
const environmentId = context.context.getEnvironmentId();
let response = await context.util.models.response.getLatestForRequestId(id, environmentId);

@@ -140,3 +150,3 @@ let shouldResend = false;

if (field !== 'raw' && !filter) {
if (isFilterableField(field) && !filter) {
throw new Error(`No ${field} filter specified`);

@@ -149,2 +159,4 @@ }

return matchHeader(response.headers, sanitizedFilter);
} else if (field === 'url') {
return response.url;
} else if (field === 'raw') {

@@ -151,0 +163,0 @@ const bodyBuffer = context.util.models.response.getBodyBuffer(response, '');

4

package.json
{
"name": "insomnia-plugin-response",
"version": "2.1.4",
"version": "2.1.6",
"author": "Gregory Schier <greg.schier@konghq.com>",

@@ -23,3 +23,3 @@ "description": "Insomnia response template tag",

},
"gitHead": "10d7255800563f4f579df1291221a70a4d973a7a"
"gitHead": "6ee442c01956adf31f7ee53da277ebe3b4696e76"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc