Socket
Socket
Sign inDemoInstall

postman-collection

Package Overview
Dependencies
Maintainers
4
Versions
180
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postman-collection - npm Package Compare versions

Comparing version 1.1.1-beta.1 to 1.1.1-beta.2

5

CHANGELOG.md
# Postman Collection SDK Changelog
#### Unreleased
* Ensure that `Xyz.isXyz()` functions always return a boolean
* Fixed a bug which caused `Request` to not initialize headers
#### 1.1.0 (April 03, 2017)
* Enhanced the `PropertyList` to allow keys with multiple values

@@ -4,0 +9,0 @@ * Removed Response details `fromServer` flag

2

lib/collection/certificate-list.js

@@ -74,3 +74,3 @@ var _ = require('../util').lodash,

isCertificateList: function (obj) {
return obj && ((obj instanceof CertificateList) ||
return Boolean(obj) && ((obj instanceof CertificateList) ||
_.inSuperChain(obj.constructor, '_postman_propertyName', CertificateList._postman_propertyName));

@@ -77,0 +77,0 @@ }

@@ -219,3 +219,3 @@ var _ = require('../util').lodash,

isCollection: function (obj) {
return obj && ((obj instanceof Collection) ||
return Boolean(obj) && ((obj instanceof Collection) ||
_.inSuperChain(obj.constructor, '_postman_propertyName', Collection._postman_propertyName));

@@ -222,0 +222,0 @@ }

@@ -227,3 +227,3 @@ var _ = require('../util').lodash,

isCookie: function (obj) {
return obj && ((obj instanceof Cookie) ||
return Boolean(obj) && ((obj instanceof Cookie) ||
_.inSuperChain(obj.constructor, '_postman_propertyName', Cookie._postman_propertyName));

@@ -230,0 +230,0 @@ },

@@ -181,3 +181,3 @@ var _ = require('../util').lodash,

isDescription: function (obj) {
return obj && ((obj instanceof Description) ||
return Boolean(obj) && ((obj instanceof Description) ||
_.inSuperChain(obj.constructor, '_postman_propertyName', Description._postman_propertyName));

@@ -184,0 +184,0 @@ }

@@ -79,3 +79,3 @@ var _ = require('../util').lodash,

isEventList: function (obj) {
return obj && ((obj instanceof EventList) ||
return Boolean(obj) && ((obj instanceof EventList) ||
_.inSuperChain(obj.constructor, '_postman_propertyName', EventList._postman_propertyName));

@@ -82,0 +82,0 @@ }

@@ -200,3 +200,3 @@ var util = require('../util'),

isHeader: function (obj) {
return obj && ((obj instanceof Header) ||
return Boolean(obj) && ((obj instanceof Header) ||
_.inSuperChain(obj.constructor, '_postman_propertyName', Header._postman_propertyName));

@@ -203,0 +203,0 @@ },

@@ -220,3 +220,5 @@ var _ = require('../util').lodash,

_createNewGroupOrItem: function (item) {
return item && (item.item && (new ItemGroup(item)) || (new Item(item)));
if (Item.isItem(item) || ItemGroup.isItemGroup(item)) { return item; }
return item && item.item ? new ItemGroup(item) : new Item(item);
},

@@ -231,3 +233,3 @@

isItemGroup: function (obj) {
return obj && ((obj instanceof ItemGroup) ||
return Boolean(obj) && ((obj instanceof ItemGroup) ||
_.inSuperChain(obj.constructor, '_postman_propertyName', ItemGroup._postman_propertyName));

@@ -234,0 +236,0 @@ }

@@ -194,3 +194,3 @@ var _ = require('../util').lodash,

isItem: function (obj) {
return obj && ((obj instanceof Item) ||
return Boolean(obj) && ((obj instanceof Item) ||
_.inSuperChain(obj.constructor, '_postman_propertyName', Item._postman_propertyName));

@@ -197,0 +197,0 @@ }

@@ -175,3 +175,3 @@ var _ = require('../util').lodash,

this.insert((item.constructor === this.Type) ? item :
// if the prperty has acreate static function, use it.
// if the property has a create static function, use it.
// eslint-disable-next-line prefer-spread

@@ -249,2 +249,12 @@ (_.has(this.Type, 'create') ? this.Type.create.apply(this.Type, arguments) : new this.Type(item)));

/**
* Clears the list and adds new items.
*
* @param {Object|Array} items
*/
repopulate: function (items) {
this.clear();
this.populate(items);
},
/**
* Returns a map of all items

@@ -442,3 +452,3 @@ * @returns {Object}

isPropertyList: function (obj) {
return obj && ((obj instanceof PropertyList) ||
return Boolean(obj) && ((obj instanceof PropertyList) ||
_.inSuperChain(obj.constructor, '_postman_propertyName', PropertyList._postman_propertyName));

@@ -445,0 +455,0 @@ }

@@ -67,3 +67,3 @@ var _ = require('../util').lodash,

isProxyConfigList: function (obj) {
return obj && ((obj instanceof ProxyConfigList) ||
return Boolean(obj) && ((obj instanceof ProxyConfigList) ||
_.inSuperChain(obj.constructor, '_postman_propertyName', ProxyConfigList._postman_propertyName));

@@ -70,0 +70,0 @@ }

@@ -134,3 +134,3 @@ var _ = require('../util').lodash,

isProxyConfig: function (obj) {
return obj && ((obj instanceof ProxyConfig) ||
return Boolean(obj) && ((obj instanceof ProxyConfig) ||
_.inSuperChain(obj.constructor, '_postman_propertyName', ProxyConfig._postman_propertyName));

@@ -137,0 +137,0 @@ }

@@ -22,3 +22,3 @@ var _ = require('../util').lodash,

QueryParam = function PostmanQueryParam (options) {
// this constructor is intended to inherit and as such the super constructor is required to be excuted
// this constructor is intended to inherit and as such the super constructor is required to be executed
QueryParam.super_.apply(this, arguments);

@@ -25,0 +25,0 @@

@@ -36,5 +36,2 @@ var _ = require('../util').lodash,

// in case definition object is missing, create an empty one
options = options || {};
// if the definition is a string, it implies that this is a get of URL

@@ -45,26 +42,46 @@ (typeof options === 'string') && (options = {

this.update(options);
}), Property);
_.assign(Request.prototype, /** @lends Request.prototype */ {
update: function (options) {
var url = _.createDefined(options, 'url', Url) || new Url();
_.mergeDefined(this, /** @lends Request.prototype */ {
// Create the default properties
_.assign(this, /** @lends Request.prototype */ {
/**
* @type {Url}
*/
url: url,
url: new Url(),
/**
* @type {String}
* @type {PropertyList<Header>}
*/
method: (options.method || 'GET').toUpperCase(),
headers: new PropertyList(Header, this, options && options.header),
/**
* @type {PropertyList<Header>}
* @type {String}
*/
headers: new PropertyList(Header, this, options.header),
method: (_.get(options, 'method', 'GET')).toUpperCase()
});
this.update(options);
}), Property);
_.assign(Request.prototype, /** @lends Request.prototype */ {
/**
* Updates the different properties of the request.
*
* @param {Object} options
*/
update: function (options) {
// Nothing to do
if (!options) { return; }
// The existing url is updated.
_.has(options, 'url') && this.url.update(options.url);
// The existing list of headers must be cleared before adding the given headers to it.
options.header && this.headers.repopulate(options.header);
// Only update the method if one is provided.
_.has(options, 'method') &&
(this.method = _.isString(options.method) ? options.method.toUpperCase() : options.method);
// The rest of the properties are not assumed to exist so we merge in the defined ones.
_.mergeDefined(this, /** @lends Request.prototype */ {
/**

@@ -264,3 +281,3 @@ * @type {RequestBody|undefined}

isRequest: function (obj) {
return obj && ((obj instanceof Request) ||
return Boolean(obj) && ((obj instanceof Request) ||
_.inSuperChain(obj.constructor, '_postman_propertyName', Request._postman_propertyName));

@@ -267,0 +284,0 @@ }

@@ -417,3 +417,3 @@ var util = require('../util'),

isResponse: function (obj) {
return obj && ((obj instanceof Response) ||
return Boolean(obj) && ((obj instanceof Response) ||
_.inSuperChain(obj.constructor, '_postman_propertyName', Response._postman_propertyName));

@@ -420,0 +420,0 @@ },

@@ -72,3 +72,3 @@ var _ = require('../util').lodash,

isScript: function (obj) {
return obj && ((obj instanceof Script) ||
return Boolean(obj) && ((obj instanceof Script) ||
_.inSuperChain(obj.constructor, '_postman_propertyName', Script._postman_propertyName));

@@ -75,0 +75,0 @@ }

@@ -405,3 +405,3 @@ var _ = require('../util').lodash,

isUrl: function (obj) {
return obj && ((obj instanceof Url) ||
return Boolean(obj) && ((obj instanceof Url) ||
_.inSuperChain(obj.constructor, '_postman_propertyName', Url._postman_propertyName));

@@ -408,0 +408,0 @@ }

@@ -209,3 +209,3 @@ var _ = require('../util').lodash,

isVariableList: function (obj) {
return obj && ((obj instanceof VariableList) ||
return Boolean(obj) && ((obj instanceof VariableList) ||
_.inSuperChain(obj.constructor, '_postman_propertyName', VariableList._postman_propertyName));

@@ -212,0 +212,0 @@ },

@@ -148,3 +148,3 @@ var _ = require('../util').lodash,

isVariableScope: function (obj) {
return obj && ((obj instanceof VariableScope) ||
return Boolean(obj) && ((obj instanceof VariableScope) ||
_.inSuperChain(obj.constructor, '_postman_propertyName', VariableScope._postman_propertyName));

@@ -151,0 +151,0 @@ }

@@ -214,3 +214,3 @@ var _ = require('../util').lodash,

isVariable: function (obj) {
return obj && ((obj instanceof Variable) ||
return Boolean(obj) && ((obj instanceof Variable) ||
_.inSuperChain(obj.constructor, '_postman_propertyName', Variable._postman_propertyName));

@@ -217,0 +217,0 @@ }

@@ -5,3 +5,3 @@ {

"author": "Postman Labs <help@getpostman.com>",
"version": "1.1.1-beta.1",
"version": "1.1.1-beta.2",
"keywords": [

@@ -57,3 +57,3 @@ "postman"

"async": "2.3.0",
"browserify": "13.1.1",
"browserify": "14.2.0",
"colors": "1.1.2",

@@ -67,6 +67,6 @@ "eslint": "3.17.1",

"istanbul": "0.4.5",
"js-yaml": "3.8.2",
"js-yaml": "3.8.3",
"jsdoc": "3.4.3",
"jsdoc-to-markdown": "3.0.0",
"karma": "1.5.0",
"karma": "1.6.0",
"karma-browserify": "5.1.1",

@@ -73,0 +73,0 @@ "karma-chrome-launcher": "2.0.0",

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