postman-collection
Advanced tools
Comparing version 1.1.0-beta.5 to 1.1.0
# Postman Collection SDK Changelog | ||
#### 1.1.0-beta.5 (March 30, 2017) | ||
* Removed Response details `fromServer` flag. | ||
* Added Response details `standardName` property. | ||
#### 1.1.0-beta.4 (March 29, 2017) | ||
* Added `set`, `get`, `unset` and `clear `helpers to `VariableScope`. | ||
* Fixed a bug in `PropertyList#clear` which caused only the first property of a list to be removed. | ||
#### 1.1.0-beta.3 (March 27, 2017) | ||
* Added `Response#details` helper to retain custom server HTTP reasons. | ||
#### 1.1.0-beta.2 (March 24, 2017) | ||
* Fixed a script resolution bug in `Event#update`. | ||
* Enhanced the `PropertyList` to allow keys with multiple values | ||
* Removed Response details `fromServer` flag | ||
* Added Response details `standardName` property | ||
* Added `set`, `get`, `unset` and `clear `helpers to `VariableScope` | ||
* Fixed a bug in `PropertyList#clear` which caused only the first property of a list to be removed | ||
* Added `Response#details` helper to retain custom server HTTP reasons | ||
* Fixed a script resolution bug in `Event#update` | ||
* Added `Response.isResponse` and `Script.isScript` helpers | ||
#### 1.1.0-beta.1 (March 24, 2017) | ||
* Added `Request.isRequest` helper | ||
@@ -20,0 +12,0 @@ |
@@ -54,2 +54,6 @@ var _ = require('../util').lodash, | ||
// if the type allows multiple values, set the flag | ||
_.getOwn(type, '_postman_propertyAllowsMultipleValues') && (this._postman_propertyAllowsMultipleValues = | ||
type._postman_propertyAllowsMultipleValues); | ||
// prepopulate | ||
@@ -114,3 +118,15 @@ populate && this.populate(populate); | ||
this._postman_listIndexCaseInsensitive && (index = index.toLowerCase()); | ||
this.reference[index] = item; | ||
// if multiple values are allowed, the reference may contain an array of items, mapped to an index. | ||
if (this._postman_propertyAllowsMultipleValues && this.reference.hasOwnProperty(index)) { | ||
// if the value is not an array, convert it to an array. | ||
!_.isArray(this.reference[index]) && (this.reference[index] = [this.reference[index]]); | ||
// add the item to the array of items corresponding to this index | ||
this.reference[index].push(item); | ||
} | ||
else { | ||
this.reference[index] = item; | ||
} | ||
} | ||
@@ -242,3 +258,3 @@ }, | ||
/** | ||
* Get Item in this list by `ID` reference | ||
* Get Item in this list by `ID` reference. If multiple values are allowed, the last value is returned. | ||
* | ||
@@ -249,3 +265,9 @@ * @param {String} id | ||
one: function (id) { | ||
return this.reference[this._postman_listIndexCaseInsensitive ? String(id).toLowerCase() : id]; | ||
var val = this.reference[this._postman_listIndexCaseInsensitive ? String(id).toLowerCase() : id]; | ||
if (this._postman_propertyAllowsMultipleValues && Array.isArray(val)) { | ||
return val.length ? val[val.length - 1] : undefined; | ||
} | ||
return val; | ||
}, | ||
@@ -252,0 +274,0 @@ |
@@ -264,3 +264,3 @@ var _ = require('../util').lodash, | ||
// in any case variable without `key` is useless | ||
_.isArray(items) && (items = _.indexBy(items, Variable._postman_propertyIndexKey)); | ||
_.isArray(items) && (items = _.keyBy(items, Variable._postman_propertyIndexKey)); | ||
// create an object with `key` as keys and an instance of `Variable` as their value. | ||
@@ -267,0 +267,0 @@ return _.mapValues(items, function (item, key) { |
@@ -68,3 +68,3 @@ var _ = require('../util').lodash, | ||
// If a variable by the name key was not found in the previous lookup, create a new variable and insert it. | ||
// If a variable by the name key exists, update it's value and return. | ||
if (variable) { return variable.set(value); } | ||
@@ -71,0 +71,0 @@ |
@@ -139,3 +139,3 @@ /* global btoa */ | ||
* @param {String} prop | ||
* @param {*} def | ||
* @param {*=} def | ||
* | ||
@@ -142,0 +142,0 @@ * @returns {*} |
@@ -5,3 +5,3 @@ { | ||
"author": "Postman Labs <help@getpostman.com>", | ||
"version": "1.1.0-beta.5", | ||
"version": "1.1.0", | ||
"keywords": [ | ||
@@ -49,3 +49,3 @@ "postman" | ||
"mime-format": "2.0.0", | ||
"mime-types": "2.1.14", | ||
"mime-types": "2.1.15", | ||
"node-oauth1": "1.2.1", | ||
@@ -57,3 +57,3 @@ "sanitize-html": "1.14.1", | ||
"devDependencies": { | ||
"async": "2.1.5", | ||
"async": "2.3.0", | ||
"browserify": "13.1.1", | ||
@@ -80,3 +80,3 @@ "colors": "1.1.2", | ||
"packity": "0.3.2", | ||
"parse-gitignore": "0.3.1", | ||
"parse-gitignore": "0.4.0", | ||
"postman-jsdoc-theme": "0.0.2", | ||
@@ -83,0 +83,0 @@ "postman-request": "2.80.1-postman.1", |
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
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
390511
8501
0
+ Addedmime-db@1.27.0(transitive)
+ Addedmime-types@2.1.15(transitive)
- Removedmime-db@1.26.0(transitive)
- Removedmime-types@2.1.14(transitive)
Updatedmime-types@2.1.15