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.2.0 to 1.2.1

lib/collection/cookie-list.js

5

CHANGELOG.md
# Postman Collection SDK Changelog
#### 1.2.1 (April 25, 2017)
* Improved documentation
* Added a new property, `CookieList`
* Fixed a bug in the `RequestAuth` implementation which caused authorization step to be skipped
#### 1.2.0 (April 24, 2017)

@@ -4,0 +9,0 @@ * Added support for variable types via VariableScope `.set` function

40

lib/collection/certificate.js

@@ -13,21 +13,21 @@ var _ = require('../util').lodash,

/**
* The following is the object representation accepted as param for the Certificate constructor.
* Also the type of the object returned when {@link Property#toJSON} or {@link Property#toObjectResolved} is called on a
* Certificate instance.
* @typedef Certificate~definition
* @property {String} [name] A name for the certificate
* @property {Array} [matches] A list of match patterns
* @property {{ src: (String) }} [key] Object with path on the file system for private key file, as src
* @property {{ src: (String) }} [cert] Object with path on the file system fot certificate file, as src
* @property {String} [passphrase] The passphrase for the certificate key
*
* @example <caption>JSON definition of an example certificate object</caption>
* {
* name: 'My certificate for example.com',
* matches: ['https://example.com/*'],
* key: { src: '/path/to/key' },
* cert: { src: '/User/path/to/certificate' },
* passphrase: 'iampassphrase'
* }
*/
* The following is the object representation accepted as param for the Certificate constructor.
* Also the type of the object returned when {@link Property#toJSON} or {@link Property#toObjectResolved} is called on a
* Certificate instance.
* @typedef Certificate~definition
* @property {String} [name] A name for the certificate
* @property {Array} [matches] A list of match patterns
* @property {{ src: (String) }} [key] Object with path on the file system for private key file, as src
* @property {{ src: (String) }} [cert] Object with path on the file system fot certificate file, as src
* @property {String} [passphrase] The passphrase for the certificate key
*
* @example <caption>JSON definition of an example certificate object</caption>
* {
* name: 'My certificate for example.com',
* matches: ['https://example.com/*'],
* key: { src: '/path/to/key' },
* cert: { src: '/User/path/to/certificate' },
* passphrase: 'iampassphrase'
* }
*/
_.inherit((

@@ -80,3 +80,3 @@

_.mergeDefined(this, {
_.mergeDefined(this, /** @lends Certificate.prototype */ {
/**

@@ -83,0 +83,0 @@ * Unique identifier

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

_.assign(Collection.prototype, {
_.assign(Collection.prototype, /** @lends Collection.prototype */ {
/**

@@ -162,0 +162,0 @@ * Using this function, one can sync the values of collection variables from a reference object.

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

authorize: function (request) {
if (!request.auth || !request.auth.type) { return request; }
if (!request.auth) { return request; }
var type = request.auth.type,
handler = this.types[type];
var handler = request.auth.current();

@@ -235,0 +234,0 @@ if (!handler || !handler.authorize) { // If no auth type is associated with a request, get outta here.

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

Header = require('./header').Header,
Cookie = require('./cookie').Cookie,
PropertyList = require('./property-list').PropertyList,
CookieList = require('./cookie-list').CookieList,
HeaderList = require('./header-list').HeaderList,

@@ -185,5 +184,5 @@

/**
* @type {PropertyList<Cookie>}
* @type {CookieList}
*/
cookies: new PropertyList(Cookie, this, options.cookie),
cookies: new CookieList(this, options.cookie),

@@ -190,0 +189,0 @@ /**

@@ -8,6 +8,31 @@ var _ = require('../util').lodash,

/**
* Environment and Globals of postman is exported and imported in a specified data structure. This data structure can be
* passed on to the constructor parameter of {@link VariableScope} or {@link VariableList} to instantiate an instance of
* the same with pre-populated values from arguments.
*
* @typedef VariableScope~definition
* @property {String} [id] ID of the scope
* @property {String} [name] A name of the scope
* @property {Array.<Variable~definition>} [values] A list of variables defined in an array in form of `{name:String,
* value:String}`
*
* @example <caption>JSON definition of a VariableScope (environment, globals, etc)</caption>
* {
* "name": "globals",
* "values": [{
* "key": "var-1",
* "value": "value-1"
* }, {
* "key": "var-2",
* "value": "value-2"
* }]
* }
*/
_.inherit((
/**
* Create instances of environments and globals
* VariableScope is a representation of a list of variables in Postman, such as the environment variables or the
* globals. Using this object, it is easy to perform operations on this list of variables such as get a variable or
* set a variable.
*

@@ -17,3 +42,19 @@ * @constructor

*
* @param {Object} definition
* @param {VariableScope~definition} definition The constructor accepts an initial set of values for initialising
* the scope
*
* @example <caption>Load a environment from file, modify and save back</caption>
* var fs = require('fs'), // assuming NodeJS
* env,
* sum;
*
* // load env from file assuming it has initial data
* env = new VariableScope(JSON.parse(fs.readFileSync('./my-postman-environment.postman_environment').toString()));
*
* // get two variables and add them
* sum = env.get('one-var') + env.get('another-var');
*
* // save it back in environment and write to file
* env.set('sum', sum, 'number');
* fs.writeFileSync('./sum-of-vars.postman_environment', JSON.stringify(env.toJSON()));
*/

@@ -20,0 +61,0 @@ VariableScope = function PostmanVariableScope (definition) {

@@ -7,2 +7,3 @@ module.exports = {

Cookie: require('./collection/cookie').Cookie,
CookieList: require('./collection/cookie-list').CookieList,
Description: require('./collection/description').Description,

@@ -9,0 +10,0 @@ Event: require('./collection/event').Event,

#!/usr/bin/env node
/* eslint-env node, es6 */
require('shelljs/global');
require('colors');
var path = require('path'),
fs = require('fs'),
colors = require('colors'),
async = require('async'),

@@ -77,3 +77,3 @@

colors.red.bold('\nwiki publish failed.') :
colors.green(`\nwiki published successfully for "${WIKI_VERSION}".`));
colors.green(`\nwiki published successfully for ${WIKI_VERSION}`));
exit(code);

@@ -80,0 +80,0 @@ });

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

"author": "Postman Labs <help@getpostman.com>",
"version": "1.2.0",
"version": "1.2.1",
"keywords": [

@@ -8,0 +8,0 @@ "postman"

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