postman-collection
Advanced tools
Comparing version 3.5.5 to 3.6.0-beta.1
@@ -310,3 +310,3 @@ var _ = require('../util').lodash, | ||
* | ||
* @param {[Cookie]} cookies - List of cookie definition object | ||
* @param {Cookie[]} cookies - List of cookie definition object | ||
* @returns {String} | ||
@@ -313,0 +313,0 @@ */ |
@@ -19,2 +19,3 @@ var _ = require('../util').lodash, | ||
* | ||
* @private | ||
* @returns {Boolean} | ||
@@ -21,0 +22,0 @@ */ |
var _ = require('../util').lodash, | ||
// @todo discontinue in v4 | ||
urlEncoder = require('postman-url-encoder'), | ||
encodeQueryParam = require('postman-url-encoder/encoder').encodeQueryParam, | ||
@@ -209,8 +209,8 @@ Property = require('./property').Property, | ||
if (value === null) { | ||
return encode ? urlEncoder.encode(key) : key; | ||
return encode ? encodeQueryParam(key) : key; | ||
} | ||
if (encode) { | ||
key = urlEncoder.encode(key); | ||
value = urlEncoder.encode(value); | ||
key = encodeQueryParam(key); | ||
value = encodeQueryParam(value); | ||
} | ||
@@ -217,0 +217,0 @@ |
@@ -152,2 +152,3 @@ var util = require('../util'), | ||
* | ||
* @private | ||
* @param {String} str | ||
@@ -154,0 +155,0 @@ * @returns {String} |
var _ = require('../util').lodash, | ||
url_parse = require('../url-parse'), | ||
PropertyBase = require('./property-base').PropertyBase, | ||
@@ -25,16 +26,6 @@ QueryParam = require('./query-param').QueryParam, | ||
GET_0 = '[0]', | ||
GET_1 = '[1]', | ||
MATCH_1 = '$1', | ||
regexes = { | ||
// @todo: According to the IETF RFC #3986, '.' is a valid part of the protocol. Figure out a way to support it | ||
extractProtocol: /^([^:?]+):\/\/([^?#/:]*|$)/, | ||
extractHost: /^([^?#/]+)/, | ||
extractHostAuth: /^([^@]+)@/, | ||
extractPort: /:([^:]*)$/, | ||
extractPath: /.*?(?=\?|#|$)/, | ||
trimPath: /^\/((.+))$/, | ||
extractQuery: /^\?([^#]+)/, | ||
extractSearch: /#(.+)$/, | ||
splitDomain: /\.(?![^{]*\}{2})/g | ||
@@ -403,4 +394,4 @@ }, | ||
/** | ||
* Parses a string to a PostmanUrl, decomposing the URL into it's constitutent parts, such as | ||
* path, host, port, etc. | ||
* Parses a string to a PostmanUrl, decomposing the URL into it's constituent parts, | ||
* such as path, host, port, etc. | ||
* | ||
@@ -411,54 +402,20 @@ * @param {String} url | ||
parse: function (url) { | ||
url = _.trimStart(url); | ||
url = url_parse(url); | ||
var pathVariables, | ||
pathVariableKeys = {}, | ||
p = { | ||
raw: url | ||
pathVariableKeys = {}; | ||
if (url.auth) { | ||
url.auth = { | ||
user: url.auth[0], | ||
password: url.auth[1] | ||
}; | ||
// extract the protocol | ||
p.protocol = _.get(url.match(regexes.extractProtocol), GET_1); | ||
_.isString(p.protocol) && (url = url.substr(p.protocol.length + 3)); // remove that damn protocol from url | ||
// extract the host | ||
p.host = _.get(url.match(regexes.extractHost), GET_1); | ||
// if host exists there are a lot you can extract from it | ||
if (_.isString(p.host)) { | ||
url = url.substr(p.host.length); // remove host from url | ||
if ((p.auth = _.get(p.host.match(regexes.extractHostAuth), GET_1))) { | ||
p.host = p.host.substr(p.auth.length + 1); // remove auth from host | ||
p.auth = p.auth.split(AUTH_SEPARATOR); | ||
p.auth = { | ||
user: p.auth[0], | ||
password: p.auth[1] | ||
}; | ||
} | ||
// extract the port from the host | ||
p.port = _.get(p.host.match(regexes.extractPort), GET_1); | ||
p.port && (p.host = p.host.substring(0, p.host.length - p.port.length - 1)); // remove port from url | ||
p.host = _.trim(p.host, DOMAIN_SEPARATOR).split(regexes.splitDomain); // split host by subdomains | ||
} | ||
// extract the path | ||
p.path = _.get(url.match(regexes.extractPath), GET_0); | ||
if (_.isString(p.path)) { | ||
url = url.substr(p.path.length); | ||
p.path && (p.path = p.path.replace(regexes.trimPath, MATCH_1)); // remove leading slash for valid path | ||
// if path is blank string, we set it to undefined, if '/' then single blank string array | ||
p.path = p.path ? (p.path === PATH_SEPARATOR ? [E] : p.path.split(PATH_SEPARATOR)) : undefined; | ||
if (url.query) { | ||
url.query = url.query.map(QueryParam.parseSingle); | ||
} | ||
// extract the query string | ||
p.query = _.get(url.match(regexes.extractQuery), GET_1); | ||
_.isString(p.query) && ((url = url.substr(p.query.length + 1)), (p.query = QueryParam.parse(p.query))); | ||
// extract the hash | ||
p.hash = _.get(url.match(regexes.extractSearch), GET_1); | ||
// extract path variables | ||
pathVariables = _.transform(p.path, function (res, segment) { | ||
pathVariables = _.transform(url.path, function (res, segment) { | ||
// check if the segment has path variable prefix followed by the variable name and | ||
@@ -473,5 +430,4 @@ // the variable is not already added in the list. | ||
}, []); | ||
p.variable = pathVariables.length ? pathVariables : undefined; | ||
return p; | ||
url.variable = pathVariables.length ? pathVariables : undefined; | ||
return url; | ||
}, | ||
@@ -478,0 +434,0 @@ |
@@ -5,3 +5,3 @@ { | ||
"author": "Postman Labs <help@getpostman.com>", | ||
"version": "3.5.5", | ||
"version": "3.6.0-beta.1", | ||
"keywords": [ | ||
@@ -28,3 +28,3 @@ "postman" | ||
"publish-docs": "node npm/publish-docs.js", | ||
"test": "node npm/test.js", | ||
"test": "npm run test-lint && npm run test-system && npm run test-unit && npm run test-browser", | ||
"test-system": "node npm/test-system.js", | ||
@@ -41,12 +41,12 @@ "test-browser": "node npm/test-browser.js", | ||
"http-reasons": "0.1.0", | ||
"iconv-lite": "0.5.0", | ||
"iconv-lite": "0.5.1", | ||
"liquid-json": "0.3.1", | ||
"lodash": "4.17.15", | ||
"marked": "0.7.0", | ||
"marked": "0.8.0", | ||
"mime-format": "2.0.0", | ||
"mime-types": "2.1.25", | ||
"postman-url-encoder": "1.0.3", | ||
"mime-types": "2.1.26", | ||
"postman-url-encoder": "2.0.0", | ||
"sanitize-html": "1.20.1", | ||
"semver": "6.3.0", | ||
"uuid": "3.3.3" | ||
"semver": "7.1.2", | ||
"uuid": "3.4.0" | ||
}, | ||
@@ -63,6 +63,5 @@ "devDependencies": { | ||
"eslint-plugin-jsdoc": "8.1.0", | ||
"eslint-plugin-lodash": "5.1.0", | ||
"eslint-plugin-lodash": "5.1.1", | ||
"eslint-plugin-mocha": "6.2.2", | ||
"eslint-plugin-security": "1.4.0", | ||
"istanbul": "0.4.5", | ||
"js-yaml": "3.13.1", | ||
@@ -76,8 +75,10 @@ "jsdoc": "3.6.3", | ||
"karma-mocha-reporter": "2.2.5", | ||
"mocha": "6.2.2", | ||
"mustache": "3.1.0", | ||
"mocha": "7.0.1", | ||
"mustache": "4.0.0", | ||
"nyc": "14.1.1", | ||
"parse-gitignore": "1.0.1", | ||
"postman-jsdoc-theme": "0.0.3", | ||
"postman-request": "2.88.1-postman.16", | ||
"postman-request": "2.88.1-postman.18", | ||
"puppeteer": "1.20.0", | ||
"recursive-readdir": "2.2.2", | ||
"require-all": "3.0.0", | ||
@@ -84,0 +85,0 @@ "schema-compiler": "0.0.3", |
@@ -1,5 +0,3 @@ | ||
# Postman Collection SDK | ||
# Postman Collection SDK [![Build Status](https://travis-ci.org/postmanlabs/postman-collection.svg?branch=develop)](https://travis-ci.org/postmanlabs/postman-collection) [![codecov](https://codecov.io/gh/postmanlabs/postman-collection/branch/develop/graph/badge.svg)](https://codecov.io/gh/postmanlabs/postman-collection) | ||
[![Build Status](https://travis-ci.org/postmanlabs/postman-collection.svg?branch=master)](https://travis-ci.org/postmanlabs/postman-collection) | ||
Postman Collection SDK is a NodeJS module that allows a developer to work with Postman Collections. Using this module a | ||
@@ -6,0 +4,0 @@ developer can create collections, manipulate them and then export them in a format that the Postman Apps and Postman CLI |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
538529
78
11694
32
1
62
+ Addedfaker@5.5.3(transitive)
+ Addediconv-lite@0.5.10.6.2(transitive)
+ Addedlodash@4.17.21(transitive)
+ Addedlru-cache@6.0.0(transitive)
+ Addedmarked@0.8.02.0.1(transitive)
+ Addedmime-db@1.43.01.47.0(transitive)
+ Addedmime-format@2.0.1(transitive)
+ Addedmime-types@2.1.262.1.30(transitive)
+ Addedpostman-collection@3.6.11(transitive)
+ Addedpostman-url-encoder@2.0.03.0.1(transitive)
+ Addedpunycode@2.3.1(transitive)
+ Addedsemver@7.1.27.3.5(transitive)
+ Addeduuid@3.4.0(transitive)
+ Addedyallist@4.0.0(transitive)
- Removediconv-lite@0.5.0(transitive)
- Removedmarked@0.7.0(transitive)
- Removedmime-db@1.42.0(transitive)
- Removedmime-types@2.1.25(transitive)
- Removedpostman-url-encoder@1.0.3(transitive)
- Removedsemver@6.3.0(transitive)
- Removeduuid@3.3.3(transitive)
Updatediconv-lite@0.5.1
Updatedmarked@0.8.0
Updatedmime-types@2.1.26
Updatedpostman-url-encoder@2.0.0
Updatedsemver@7.1.2
Updateduuid@3.4.0