Socket
Socket
Sign inDemoInstall

postman-collection-transformer

Package Overview
Dependencies
7
Maintainers
4
Versions
148
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 4.1.4 to 4.1.5

36

lib/converters/v2.0.0/converter-v2-to-v1.js

@@ -359,2 +359,3 @@ /* eslint-disable object-shorthand */

response = {},
handlePartial = self.options.handlePartial,
id = responseV2.id || responseV2._postman_id,

@@ -392,2 +393,12 @@ originalRequest = responseV2.originalRequest || responseV2.request;

if (handlePartial) {
(!(responseV2.code || responseV2.status)) && (response.responseCode = undefined);
(responseV2.cookies === undefined) && (response.cookies = undefined);
(responseV2.body === undefined) && (
response.rawDataType =
response.language =
response.previewType = undefined
);
}
return response;

@@ -455,3 +466,6 @@ },

retainEmpty = self.options.retainEmptyValues,
urlObj = _.isString(url) ? util.urlparse(url) : url;
handlePartial = self.options.handlePartial,
urlObj = _.isString(url) ? util.urlparse(url) : url,
headers = req && (req.headers || req.header),
pathVariables = urlObj && (urlObj.variables || urlObj.variable);

@@ -515,3 +529,3 @@ if (!skipResponses) {

// description transformations for v2 to v1
urlObj && (request.pathVariableData = _.map(urlObj.variables || urlObj.variable, function (v) {
urlObj && (request.pathVariableData = _.map(pathVariables, function (v) {
var result = { key: v.key || v.id, value: v.value };

@@ -537,3 +551,3 @@

// item truthiness is already validated by this point
request.headerData = _.map(item.request && (item.request.headers || item.request.header), function (header) {
request.headerData = _.map(headers, function (header) {
// Prevents empty query param descriptions from showing up in the result, keeps collections clean.

@@ -548,2 +562,9 @@ header.description = self.description(header.description);

// In case of a partial transformation, remove undefined fields
if (handlePartial) {
(headers === undefined) && (request.headers = request.headerData = undefined);
(item.responses === undefined) && (request.responses = request.responses_order = undefined);
(url === undefined) && (request.url = request.pathVariableData = request.queryParams = undefined);
}
return request;

@@ -797,2 +818,11 @@ },

if (options && options.handlePartial) {
(!collection.item) && (
newCollection.requests =
newCollection.folders =
newCollection.folders_order =
newCollection.order = undefined
);
}
if (callback) {

@@ -799,0 +829,0 @@ return callback(null, newCollection);

16

package.json
{
"name": "postman-collection-transformer",
"version": "4.1.4",
"version": "4.1.5",
"description": "Perform rapid conversation and validation of JSON structure between Postman Collection Format v1 and v2",

@@ -42,13 +42,13 @@ "author": "Postman Inc.",

"devDependencies": {
"async": "^3.2.1",
"async": "^3.2.3",
"browserify": "^17.0.0",
"chai": "^4.3.4",
"chai": "^4.3.6",
"chalk": "^4.1.2",
"eslint": "^7.22.0",
"eslint-plugin-jsdoc": "^36.1.1",
"eslint-plugin-lodash": "^7.3.0",
"eslint-plugin-lodash": "^7.4.0",
"eslint-plugin-mocha": "^9.0.0",
"eslint-plugin-security": "^1.4.0",
"js-yaml": "^4.0.0",
"karma": "^6.3.5",
"karma": "^6.3.16",
"karma-browserify": "^8.1.0",

@@ -58,5 +58,5 @@ "karma-chrome-launcher": "^3.1.0",

"karma-mocha-reporter": "^2.2.5",
"mocha": "^9.1.3",
"mocha": "^9.2.1",
"nyc": "^15.1.0",
"packity": "^0.3.2",
"packity": "^0.3.4",
"parse-gitignore": "^1.0.1",

@@ -66,3 +66,3 @@ "pretty-ms": "^7.0.1",

"require-all": "^3.0.0",
"shelljs": "^0.8.4",
"shelljs": "^0.8.5",
"superagent": "^6.1.0",

@@ -69,0 +69,0 @@ "tv4": "^1.3.0",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc